Skip to content

Commit abd69c0

Browse files
ukleinekjic23
authored andcommitted
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>
1 parent e50856d commit abd69c0

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

drivers/iio/adc/ad7091r5.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,23 +101,17 @@ static const struct ad7091r_init_info ad7091r5_init_info = {
101101

102102
static int ad7091r5_i2c_probe(struct i2c_client *i2c)
103103
{
104-
const struct ad7091r_init_info *init_info;
105-
106-
init_info = i2c_get_match_data(i2c);
107-
if (!init_info)
108-
return -EINVAL;
109-
110-
return ad7091r_probe(&i2c->dev, init_info, i2c->irq);
104+
return ad7091r_probe(&i2c->dev, &ad7091r5_init_info, i2c->irq);
111105
}
112106

113107
static const struct of_device_id ad7091r5_dt_ids[] = {
114-
{ .compatible = "adi,ad7091r5", .data = &ad7091r5_init_info },
108+
{ .compatible = "adi,ad7091r5" },
115109
{ }
116110
};
117111
MODULE_DEVICE_TABLE(of, ad7091r5_dt_ids);
118112

119113
static const struct i2c_device_id ad7091r5_i2c_ids[] = {
120-
{ "ad7091r5", (kernel_ulong_t)&ad7091r5_init_info },
114+
{ .name = "ad7091r5" },
121115
{ }
122116
};
123117
MODULE_DEVICE_TABLE(i2c, ad7091r5_i2c_ids);

0 commit comments

Comments
 (0)