lkml.org 
[lkml]   [2023]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] iio: pressure: bmp280: Use i2c_get_match_data
Date
Replaces device_get_match_data() and fallback match_id logic by new
unified helper function i2c_get_match_data().

Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com>

diff --git a/drivers/iio/pressure/bmp280-i2c.c b/drivers/iio/pressure/bmp280-i2c.c
index 693eb1975fdc..4ebaa4edc4fc 100644
--- a/drivers/iio/pressure/bmp280-i2c.c
+++ b/drivers/iio/pressure/bmp280-i2c.c
@@ -11,9 +11,9 @@ static int bmp280_i2c_probe(struct i2c_client *client)
const struct bmp280_chip_info *chip_info;
struct regmap *regmap;

- chip_info = device_get_match_data(&client->dev);
+ chip_info = i2c_get_match_data(client);
if (!chip_info)
- chip_info = (const struct bmp280_chip_info *) id->driver_data;
+ return -ENODEV;

regmap = devm_regmap_init_i2c(client, chip_info->regmap_config);
if (IS_ERR(regmap)) {
--
2.41.0
\
 
 \ /
  Last update: 2023-08-06 01:17    [W:1.402 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site