diff options
author | Biju Das <biju.das.jz@bp.renesas.com> | 2023-09-02 18:05:29 +0100 |
---|---|---|
committer | Jonathan Cameron <jonathan.cameron@huawei.com> | 2023-09-12 10:42:04 +0100 |
commit | 6c70012df1f39bb9bd015b6b6383f66cde95bc94 (patch) | |
tree | 46f60d971e19a86ac1f18866dfbfb3ca83a98a29 /drivers/iio/adc/ltc2497.c | |
parent | f6b1737921dd38919a6d25826a953bd6d04c8c4b (diff) | |
download | linux-6c70012df1f39bb9bd015b6b6383f66cde95bc94.tar.gz linux-6c70012df1f39bb9bd015b6b6383f66cde95bc94.tar.bz2 linux-6c70012df1f39bb9bd015b6b6383f66cde95bc94.zip |
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>
Diffstat (limited to 'drivers/iio/adc/ltc2497.c')
-rw-r--r-- | drivers/iio/adc/ltc2497.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/iio/adc/ltc2497.c b/drivers/iio/adc/ltc2497.c index 5bdd40729611..6401a7727c31 100644 --- a/drivers/iio/adc/ltc2497.c +++ b/drivers/iio/adc/ltc2497.c @@ -95,7 +95,6 @@ static int ltc2497_result_and_measure(struct ltc2497core_driverdata *ddata, static int ltc2497_probe(struct i2c_client *client) { - const struct i2c_device_id *id = i2c_client_get_device_id(client); const struct ltc2497_chip_info *chip_info; struct iio_dev *indio_dev; struct ltc2497_driverdata *st; @@ -115,9 +114,7 @@ static int ltc2497_probe(struct i2c_client *client) st->client = client; st->common_ddata.result_and_measure = ltc2497_result_and_measure; - chip_info = device_get_match_data(dev); - if (!chip_info) - chip_info = (const struct ltc2497_chip_info *)id->driver_data; + chip_info = i2c_get_match_data(client); st->common_ddata.chip_info = chip_info; resolution = chip_info->resolution; |