Message ID | 20230812175808.236405-1-biju.das.jz@bp.renesas.com (mailing list archive) |
---|---|
State | Handled Elsewhere |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Series | iio: pressure: bmp280: Use i2c_get_match_data() | expand |
On Sat, Aug 12, 2023 at 06:58:08PM +0100, Biju Das wrote: > Replace device_get_match_data() and id lookup for retrieving match data > by i2c_get_match_data(). ... > 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); Is id still in use?
Hi Andy, > Subject: Re: [PATCH] iio: pressure: bmp280: Use i2c_get_match_data() > > On Sat, Aug 12, 2023 at 06:58:08PM +0100, Biju Das wrote: > > Replace device_get_match_data() and id lookup for retrieving match > > data by i2c_get_match_data(). > > ... > > > 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); > > Is id still in use? Yes down, return bmp280_common_probe( ..,id->name,..); Cheers, Biju
diff --git a/drivers/iio/pressure/bmp280-i2c.c b/drivers/iio/pressure/bmp280-i2c.c index dbe630ad05b5..b3e069730f97 100644 --- a/drivers/iio/pressure/bmp280-i2c.c +++ b/drivers/iio/pressure/bmp280-i2c.c @@ -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)) {
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> --- drivers/iio/pressure/bmp280-i2c.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)