diff options
author | Giorgio Dal Molin <giorgio.nicole@arcor.de> | 2016-08-16 14:43:37 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-08-21 06:00:45 -0400 |
commit | 522caebb2c3684f4a1d154526fb5e33f1381e92a (patch) | |
tree | ebdb600c0d9709f2cd5a5795890b410d11a2d189 | |
parent | c2ab447454d498e709d9011c0f2d2945ee321f9b (diff) |
iio:ti-ads1015: fix a wrong pointer definition.
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")
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.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 1ef398770a1f..066abaf80201 100644 --- a/drivers/iio/adc/ti-ads1015.c +++ b/drivers/iio/adc/ti-ads1015.c | |||
@@ -489,7 +489,8 @@ static struct iio_info ads1115_info = { | |||
489 | #ifdef CONFIG_OF | 489 | #ifdef CONFIG_OF |
490 | static int ads1015_get_channels_config_of(struct i2c_client *client) | 490 | static int ads1015_get_channels_config_of(struct i2c_client *client) |
491 | { | 491 | { |
492 | struct ads1015_data *data = i2c_get_clientdata(client); | 492 | struct iio_dev *indio_dev = i2c_get_clientdata(client); |
493 | struct ads1015_data *data = iio_priv(indio_dev); | ||
493 | struct device_node *node; | 494 | struct device_node *node; |
494 | 495 | ||
495 | if (!client->dev.of_node || | 496 | if (!client->dev.of_node || |