Re: [PATCH] iio: imu: inv_icm45600: Use I2C match data
From: Jonathan Cameron
Date: Wed Jul 01 2026 - 17:36:41 EST
On Wed, 24 Jun 2026 13:38:23 +0800
Pengpeng Hou <pengpeng@xxxxxxxxxxx> 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@xxxxxxxxxxx>
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;
>