* [PATCH i2c-tools] i2cdetect: only use "newer" I2C_FUNC_* flags if they exist
@ 2023-02-20 14:08 Wolfram Sang
2023-02-23 11:54 ` Jean Delvare
2023-02-23 14:07 ` Wolfram Sang
0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2023-02-20 14:08 UTC (permalink / raw)
To: linux-i2c; +Cc: Jean Delvare, Wolfram Sang, Poeche, Uwe
This allows i2cdetect to be compiled for older kernels.
Reported-by: "Poeche, Uwe" <uwe.poeche@siemens.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Jean, do you mind these #ifdefs in the code?
tools/i2cdetect.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/i2cdetect.c b/tools/i2cdetect.c
index 5ab4ea4..2d4d3b4 100644
--- a/tools/i2cdetect.c
+++ b/tools/i2cdetect.c
@@ -160,12 +160,16 @@ static const struct func all_func[] = {
.name = "I2C Block Write" },
{ .value = I2C_FUNC_SMBUS_READ_I2C_BLOCK,
.name = "I2C Block Read" },
+#if defined(I2C_FUNC_SMBUS_HOST_NOTIFY)
{ .value = I2C_FUNC_SMBUS_HOST_NOTIFY,
.name = "SMBus Host Notify" },
+#endif
{ .value = I2C_FUNC_10BIT_ADDR,
.name = "10-bit addressing" },
+#if defined(I2C_FUNC_SLAVE)
{ .value = I2C_FUNC_SLAVE,
.name = "Target mode" },
+#endif
{ .value = 0, .name = "" }
};
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH i2c-tools] i2cdetect: only use "newer" I2C_FUNC_* flags if they exist
2023-02-20 14:08 [PATCH i2c-tools] i2cdetect: only use "newer" I2C_FUNC_* flags if they exist Wolfram Sang
@ 2023-02-23 11:54 ` Jean Delvare
2023-02-23 14:07 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2023-02-23 11:54 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, Poeche, Uwe
On Mon, 20 Feb 2023 15:08:29 +0100, Wolfram Sang wrote:
> This allows i2cdetect to be compiled for older kernels.
>
> Reported-by: "Poeche, Uwe" <uwe.poeche@siemens.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>
> Jean, do you mind these #ifdefs in the code?
>
> tools/i2cdetect.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tools/i2cdetect.c b/tools/i2cdetect.c
> index 5ab4ea4..2d4d3b4 100644
> --- a/tools/i2cdetect.c
> +++ b/tools/i2cdetect.c
> @@ -160,12 +160,16 @@ static const struct func all_func[] = {
> .name = "I2C Block Write" },
> { .value = I2C_FUNC_SMBUS_READ_I2C_BLOCK,
> .name = "I2C Block Read" },
> +#if defined(I2C_FUNC_SMBUS_HOST_NOTIFY)
> { .value = I2C_FUNC_SMBUS_HOST_NOTIFY,
> .name = "SMBus Host Notify" },
> +#endif
> { .value = I2C_FUNC_10BIT_ADDR,
> .name = "10-bit addressing" },
> +#if defined(I2C_FUNC_SLAVE)
> { .value = I2C_FUNC_SLAVE,
> .name = "Target mode" },
> +#endif
> { .value = 0, .name = "" }
> };
>
No objection.
Reviewed-by: Jean Delvare <jdelvare@suse.de>
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH i2c-tools] i2cdetect: only use "newer" I2C_FUNC_* flags if they exist
2023-02-20 14:08 [PATCH i2c-tools] i2cdetect: only use "newer" I2C_FUNC_* flags if they exist Wolfram Sang
2023-02-23 11:54 ` Jean Delvare
@ 2023-02-23 14:07 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2023-02-23 14:07 UTC (permalink / raw)
To: linux-i2c; +Cc: Jean Delvare, Poeche, Uwe
[-- Attachment #1: Type: text/plain, Size: 296 bytes --]
On Mon, Feb 20, 2023 at 03:08:29PM +0100, Wolfram Sang wrote:
> This allows i2cdetect to be compiled for older kernels.
>
> Reported-by: "Poeche, Uwe" <uwe.poeche@siemens.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
And applied to master! Thank you, everyone.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-02-23 14:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-20 14:08 [PATCH i2c-tools] i2cdetect: only use "newer" I2C_FUNC_* flags if they exist Wolfram Sang
2023-02-23 11:54 ` Jean Delvare
2023-02-23 14:07 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).