* Re: [PATCH] iio: imu: inv_icm45600: Use I2C match data
2026-06-24 5:38 [PATCH] iio: imu: inv_icm45600: Use I2C match data Pengpeng Hou
@ 2026-06-24 6:56 ` Joshua Crofts
2026-06-24 8:33 ` Jean-Baptiste Maneyrol
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Joshua Crofts @ 2026-06-24 6:56 UTC (permalink / raw)
To: Pengpeng Hou
Cc: Remi Buisson, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, linux-iio, linux-kernel
On Wed, 24 Jun 2026 13:38:23 +0800
Pengpeng Hou <pengpeng@iscas.ac.cn> wrote:
> The I2C driver provides chip_info through both the OF match table and
> the I2C id table, but probe reads it with device_get_match_data(). That
> misses id-table driver_data for non-firmware I2C matches and can reject
> a supported device with -ENODEV.
>
> Use i2c_get_match_data() so the id-table chip_info is used when firmware
> match data is not present.
>
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
> ---
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
--
Kind regards
CJD
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] iio: imu: inv_icm45600: Use I2C match data
2026-06-24 5:38 [PATCH] iio: imu: inv_icm45600: Use I2C match data Pengpeng Hou
2026-06-24 6:56 ` Joshua Crofts
@ 2026-06-24 8:33 ` Jean-Baptiste Maneyrol
2026-06-24 11:13 ` Andy Shevchenko
2026-07-01 21:33 ` Jonathan Cameron
3 siblings, 0 replies; 5+ messages in thread
From: Jean-Baptiste Maneyrol @ 2026-06-24 8:33 UTC (permalink / raw)
To: Pengpeng Hou, Remi Buisson, Jonathan Cameron, David Lechner,
Nuno Sá,
Andy Shevchenko
Cc: linux-iio, linux-kernel
>From: Pengpeng Hou <pengpeng@iscas.ac.cn>
>Sent: Wednesday, June 24, 2026 07:38
>To: Remi Buisson; Jonathan Cameron; David Lechner; Nuno Sá; Andy Shevchenko
>Cc: linux-iio@vger.kernel.org; linux-kernel@vger.kernel.org; Pengpeng Hou
>Subject: [PATCH] iio: imu: inv_icm45600: Use I2C match data
>
>The I2C driver provides chip_info through both the OF match table and the I2C id table, but probe reads it with device_get_match_data(). That misses id-table driver_data for non-firmware I2C matches and can reject a supported device with -ENODEV.
>ZjQcmQRYFpfptBannerStart
>This Message Is From an Untrusted Sender
>You have not previously corresponded with this sender.
>
>ZjQcmQRYFpfptBannerEnd
>
>The I2C driver provides chip_info through both the OF match table and
>the I2C id table, but probe reads it with device_get_match_data(). That
>misses id-table driver_data for non-firmware I2C matches and can reject
>a supported device with -ENODEV.
>
>Use i2c_get_match_data() so the id-table chip_info is used when firmware
>match data is not present.
>
>Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
>---
> drivers/iio/imu/inv_icm45600/inv_icm45600_i2c.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/iio/imu/inv_icm45600/inv_icm45600_i2c.c b/drivers/iio/imu/inv_icm45600/inv_icm45600_i2c.c
>index 5ebc18121a11..c65e5501eee7 100644
>--- a/drivers/iio/imu/inv_icm45600/inv_icm45600_i2c.c
>+++ b/drivers/iio/imu/inv_icm45600/inv_icm45600_i2c.c
>@@ -23,7 +23,7 @@ static int inv_icm45600_probe(struct i2c_client *client)
> if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_I2C_BLOCK))
> return -ENODEV;
>
>- chip_info = device_get_match_data(&client->dev);
>+ chip_info = i2c_get_match_data(client);
> if (!chip_info)
> return -ENODEV;
>
>--
>2.50.1 (Apple Git-155)
>
Hello Pengpeng,
good stuff, thanks for your patch.
Reviewed-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Thanks,
JB
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: imu: inv_icm45600: Use I2C match data
2026-06-24 5:38 [PATCH] iio: imu: inv_icm45600: Use I2C match data Pengpeng Hou
2026-06-24 6:56 ` Joshua Crofts
2026-06-24 8:33 ` Jean-Baptiste Maneyrol
@ 2026-06-24 11:13 ` Andy Shevchenko
2026-07-01 21:33 ` Jonathan Cameron
3 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2026-06-24 11:13 UTC (permalink / raw)
To: Pengpeng Hou
Cc: Remi Buisson, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, linux-iio, linux-kernel
On Wed, Jun 24, 2026 at 01:38:23PM +0800, Pengpeng Hou wrote:
> The I2C driver provides chip_info through both the OF match table and
> the I2C id table, but probe reads it with device_get_match_data(). That
> misses id-table driver_data for non-firmware I2C matches and can reject
> a supported device with -ENODEV.
>
> Use i2c_get_match_data() so the id-table chip_info is used when firmware
> match data is not present.
Currently there is no problem with that. But in principle I agree with
the change. Also it makes it on par with SPI glue driver.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: imu: inv_icm45600: Use I2C match data
2026-06-24 5:38 [PATCH] iio: imu: inv_icm45600: Use I2C match data Pengpeng Hou
` (2 preceding siblings ...)
2026-06-24 11:13 ` Andy Shevchenko
@ 2026-07-01 21:33 ` Jonathan Cameron
3 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2026-07-01 21:33 UTC (permalink / raw)
To: Pengpeng Hou
Cc: Remi Buisson, David Lechner, Nuno Sá,
Andy Shevchenko, linux-iio, linux-kernel
On Wed, 24 Jun 2026 13:38:23 +0800
Pengpeng Hou <pengpeng@iscas.ac.cn> wrote:
> The I2C driver provides chip_info through both the OF match table and
> the I2C id table, but probe reads it with device_get_match_data(). That
> misses id-table driver_data for non-firmware I2C matches and can reject
> a supported device with -ENODEV.
>
> Use i2c_get_match_data() so the id-table chip_info is used when firmware
> match data is not present.
>
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Applied to the testing branch of iio.git.
Thanks,
Jonathan
> ---
> drivers/iio/imu/inv_icm45600/inv_icm45600_i2c.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/imu/inv_icm45600/inv_icm45600_i2c.c b/drivers/iio/imu/inv_icm45600/inv_icm45600_i2c.c
> index 5ebc18121a11..c65e5501eee7 100644
> --- a/drivers/iio/imu/inv_icm45600/inv_icm45600_i2c.c
> +++ b/drivers/iio/imu/inv_icm45600/inv_icm45600_i2c.c
> @@ -23,7 +23,7 @@ static int inv_icm45600_probe(struct i2c_client *client)
> if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_I2C_BLOCK))
> return -ENODEV;
>
> - chip_info = device_get_match_data(&client->dev);
> + chip_info = i2c_get_match_data(client);
> if (!chip_info)
> return -ENODEV;
>
^ permalink raw reply [flat|nested] 5+ messages in thread