Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: pressure: ms5637: Use i2c_get_match_data()

Simplify probe() by replacing id lookup for retrieving match data and
device_get_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/20230903145926.66855-1-biju.das.jz@bp.renesas.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Biju Das and committed by
Jonathan Cameron
22da192f c377e2fe

+1 -5
+1 -5
drivers/iio/pressure/ms5637.c
··· 144 144 145 145 static int ms5637_probe(struct i2c_client *client) 146 146 { 147 - const struct i2c_device_id *id = i2c_client_get_device_id(client); 148 147 const struct ms_tp_data *data; 149 148 struct ms_tp_dev *dev_data; 150 149 struct iio_dev *indio_dev; ··· 158 159 return -EOPNOTSUPP; 159 160 } 160 161 161 - if (id) 162 - data = (const struct ms_tp_data *)id->driver_data; 163 - else 164 - data = device_get_match_data(&client->dev); 162 + data = i2c_get_match_data(client); 165 163 if (!data) 166 164 return -EINVAL; 167 165