diff options
| author | Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> | 2026-05-19 10:13:05 +0200 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2026-05-31 11:01:46 +0100 |
| commit | abd69c09a73bb9a74f899526b4c7a60169dcbb27 (patch) | |
| tree | ee29ddce059fbd0f2a49b893094097e7d12a600c /drivers | |
| parent | e50856dc41e8353237863d618a55d7496072c325 (diff) | |
iio: adc: ad7091r5: Simplify driver_data handling
The driver only supports a single device type. So the return value of
i2c_get_match_data() is already known and can just be hardcoded without
type casting. While at it also remove the unused .data of the
single of_device_id entry.
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/iio/adc/ad7091r5.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/iio/adc/ad7091r5.c b/drivers/iio/adc/ad7091r5.c index bd4877268689..7bf7d538abd9 100644 --- a/drivers/iio/adc/ad7091r5.c +++ b/drivers/iio/adc/ad7091r5.c @@ -101,23 +101,17 @@ static const struct ad7091r_init_info ad7091r5_init_info = { static int ad7091r5_i2c_probe(struct i2c_client *i2c) { - const struct ad7091r_init_info *init_info; - - init_info = i2c_get_match_data(i2c); - if (!init_info) - return -EINVAL; - - return ad7091r_probe(&i2c->dev, init_info, i2c->irq); + return ad7091r_probe(&i2c->dev, &ad7091r5_init_info, i2c->irq); } static const struct of_device_id ad7091r5_dt_ids[] = { - { .compatible = "adi,ad7091r5", .data = &ad7091r5_init_info }, + { .compatible = "adi,ad7091r5" }, { } }; MODULE_DEVICE_TABLE(of, ad7091r5_dt_ids); static const struct i2c_device_id ad7091r5_i2c_ids[] = { - { "ad7091r5", (kernel_ulong_t)&ad7091r5_init_info }, + { .name = "ad7091r5" }, { } }; MODULE_DEVICE_TABLE(i2c, ad7091r5_i2c_ids); |
