iio: pressure: bmp280: Use i2c_get_match_data()
authorBiju Das <biju.das.jz@bp.renesas.com>
Sun, 22 Oct 2023 17:22:17 +0000 (19:22 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 16 Nov 2023 19:10:27 +0000 (19:10 +0000)
Replace device_get_match_data() and id lookup for retrieving match data
by i2c_get_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/0554ddae62ba04ccacf58c2de04ec598c876665e.1697994521.git.ang.iglesiasg@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/pressure/bmp280-i2c.c

index dbe630ad05b5a8c820230806b46caecf53904d56..b3e069730f97214e7a5da3894cc4ef68b96d9f6a 100644 (file)
@@ -11,9 +11,7 @@ static int bmp280_i2c_probe(struct i2c_client *client)
        const struct bmp280_chip_info *chip_info;
        const struct i2c_device_id *id = i2c_client_get_device_id(client);
 
-       chip_info = device_get_match_data(&client->dev);
-       if (!chip_info)
-               chip_info = (const struct bmp280_chip_info *) id->driver_data;
+       chip_info = i2c_get_match_data(client);
 
        regmap = devm_regmap_init_i2c(client, chip_info->regmap_config);
        if (IS_ERR(regmap)) {