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

Configure Feed

Select the types of activity you want to include in your feed.

iio: potentiometer: ad5110: Use i2c_get_match_data()

Replace device_get_match_data()->i2c_get_match_data by making similar I2C
and DT-based matching table to extend matching support for ID table.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230812150838.185055-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
c4153b57 0f5cecd1

+13 -8
+13 -8
drivers/iio/potentiometer/ad5110.c
··· 278 278 }; 279 279 MODULE_DEVICE_TABLE(of, ad5110_of_match); 280 280 281 + #define AD5110_ID_TABLE(_name, cfg) { \ 282 + .name = _name, \ 283 + .driver_data = (kernel_ulong_t)&ad5110_cfg[cfg], \ 284 + } 285 + 281 286 static const struct i2c_device_id ad5110_id[] = { 282 - { "ad5110-10", AD5110_10 }, 283 - { "ad5110-80", AD5110_80 }, 284 - { "ad5112-05", AD5112_05 }, 285 - { "ad5112-10", AD5112_10 }, 286 - { "ad5112-80", AD5112_80 }, 287 - { "ad5114-10", AD5114_10 }, 288 - { "ad5114-80", AD5114_80 }, 287 + AD5110_ID_TABLE("ad5110-10", AD5110_10), 288 + AD5110_ID_TABLE("ad5110-80", AD5110_80), 289 + AD5110_ID_TABLE("ad5112-05", AD5112_05), 290 + AD5110_ID_TABLE("ad5112-10", AD5112_10), 291 + AD5110_ID_TABLE("ad5112-80", AD5112_80), 292 + AD5110_ID_TABLE("ad5114-10", AD5114_10), 293 + AD5110_ID_TABLE("ad5114-80", AD5114_80), 289 294 { } 290 295 }; 291 296 MODULE_DEVICE_TABLE(i2c, ad5110_id); ··· 310 305 data->client = client; 311 306 mutex_init(&data->lock); 312 307 data->enable = 1; 313 - data->cfg = device_get_match_data(dev); 308 + data->cfg = i2c_get_match_data(client); 314 309 315 310 /* refresh RDAC register with EEPROM */ 316 311 ret = ad5110_write(data, AD5110_RESET, 0);