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

iio: adc: ltc2497: Simplify probe()

Simpilfy probe() by replacing device_get_match_data() and id lookup for
retrieving match data by using i2c_get_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230902170529.62297-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
6c70012d f6b17379

+1 -4
+1 -4
drivers/iio/adc/ltc2497.c
··· 95 95 96 96 static int ltc2497_probe(struct i2c_client *client) 97 97 { 98 - const struct i2c_device_id *id = i2c_client_get_device_id(client); 99 98 const struct ltc2497_chip_info *chip_info; 100 99 struct iio_dev *indio_dev; 101 100 struct ltc2497_driverdata *st; ··· 114 115 st->client = client; 115 116 st->common_ddata.result_and_measure = ltc2497_result_and_measure; 116 117 117 - chip_info = device_get_match_data(dev); 118 - if (!chip_info) 119 - chip_info = (const struct ltc2497_chip_info *)id->driver_data; 118 + chip_info = i2c_get_match_data(client); 120 119 st->common_ddata.chip_info = chip_info; 121 120 122 121 resolution = chip_info->resolution;