mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-09 14:50:19 +00:00
iio: potentiometer: ds1803: Change to firmware provided data
Using firmware provided data to get the device specific structure if not available fall back to id->driver_data. Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220223163525.13399-5-jagathjog1996@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
a98d2b029b
commit
6450b62cb2
@ -15,6 +15,7 @@
|
||||
#include <linux/iio/iio.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/property.h>
|
||||
|
||||
#define DS1803_WIPER_0 0xA9
|
||||
#define DS1803_WIPER_1 0xAA
|
||||
@ -166,6 +167,8 @@ static int ds1803_probe(struct i2c_client *client, const struct i2c_device_id *i
|
||||
|
||||
data = iio_priv(indio_dev);
|
||||
data->client = client;
|
||||
data->cfg = device_get_match_data(dev);
|
||||
if (!data->cfg)
|
||||
data->cfg = &ds1803_cfg[id->driver_data];
|
||||
|
||||
indio_dev->info = &ds1803_info;
|
||||
|
Loading…
x
Reference in New Issue
Block a user