Commit 075dc2dd authored by Giorgio Dal Molin's avatar Giorgio Dal Molin Committed by Greg Kroah-Hartman

iio:ti-ads1015: fix a wrong pointer definition.

commit 522caebb 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: default avatarGiorgio Dal Molin <giorgio.nicole@arcor.de>
Fixes: ecc24e72 ("iio: adc: Add TI ADS1015 ADC driver support")
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f85bc118
...@@ -403,7 +403,8 @@ static const struct iio_info ads1015_info = { ...@@ -403,7 +403,8 @@ static const struct iio_info ads1015_info = {
#ifdef CONFIG_OF #ifdef CONFIG_OF
static int ads1015_get_channels_config_of(struct i2c_client *client) 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; struct device_node *node;
if (!client->dev.of_node || if (!client->dev.of_node ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment