diff options
author | Giorgio Dal Molin <giorgio.nicole@arcor.de> | 2016-08-16 20:43:37 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-24 10:09:30 +0200 |
commit | 075dc2dd4d94bd4747252cf0700d928a75a9ca87 (patch) | |
tree | 2000a8f5a8b7af8c858baea188e2f88a1d1a9c0b | |
parent | f85bc118fa276973c930543795a73fbb5408a358 (diff) | |
download | lwn-075dc2dd4d94bd4747252cf0700d928a75a9ca87.tar.gz lwn-075dc2dd4d94bd4747252cf0700d928a75a9ca87.zip |
iio:ti-ads1015: fix a wrong pointer definition.
commit 522caebb2c3684f4a1d154526fb5e33f1381e92a upstream.
The call to i2c_get_clientdata(client) returns a struct iio_dev*, not
the needed struct ads1015_data*. We need here an intermediate step as
in the function: void ads1015_get_channels_config(struct i2c_client *client).
Signed-off-by: Giorgio Dal Molin <giorgio.nicole@arcor.de>
Fixes: ecc24e72f437 ("iio: adc: Add TI ADS1015 ADC driver support")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/iio/adc/ti-ads1015.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c index 73cbf0b54e54..fe96af6059d5 100644 --- a/drivers/iio/adc/ti-ads1015.c +++ b/drivers/iio/adc/ti-ads1015.c @@ -403,7 +403,8 @@ static const struct iio_info ads1015_info = { #ifdef CONFIG_OF static int ads1015_get_channels_config_of(struct i2c_client *client) { - struct ads1015_data *data = i2c_get_clientdata(client); + struct iio_dev *indio_dev = i2c_get_clientdata(client); + struct ads1015_data *data = iio_priv(indio_dev); struct device_node *node; if (!client->dev.of_node || |