From: Biju Das Date: Tue, 25 Jul 2023 17:16:24 +0000 (+0100) Subject: iio: accel: adxl313: Use i2c_get_match_data X-Git-Tag: v6.6.7~2016^2~44^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=579f6b003ae230ffe81933c5941b7b7dba52370b;p=platform%2Fkernel%2Flinux-starfive.git iio: accel: adxl313: Use i2c_get_match_data Replace device_get_match_data() and i2c_match_id() by i2c_get_match _data() as we have similar I2C and DT-based matching table. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230725171624.331283-3-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/accel/adxl313_i2c.c b/drivers/iio/accel/adxl313_i2c.c index e0a860a..a4cf0cf 100644 --- a/drivers/iio/accel/adxl313_i2c.c +++ b/drivers/iio/accel/adxl313_i2c.c @@ -65,9 +65,7 @@ static int adxl313_i2c_probe(struct i2c_client *client) * Retrieves device specific data as a pointer to a * adxl313_chip_info structure */ - chip_data = device_get_match_data(&client->dev); - if (!chip_data) - chip_data = (const struct adxl313_chip_info *)i2c_match_id(adxl313_i2c_id, client)->driver_data; + chip_data = i2c_get_match_data(client); regmap = devm_regmap_init_i2c(client, &adxl31x_i2c_regmap_config[chip_data->type]);