Skip to content

Commit 522caeb

Browse files
Giorgio Dal Molinjic23
authored andcommitted
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: ecc24e7 ("iio: adc: Add TI ADS1015 ADC driver support") Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent c2ab447 commit 522caeb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/iio/adc/ti-ads1015.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,8 @@ static struct iio_info ads1115_info = {
489489
#ifdef CONFIG_OF
490490
static int ads1015_get_channels_config_of(struct i2c_client *client)
491491
{
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);
493494
struct device_node *node;
494495

495496
if (!client->dev.of_node ||

0 commit comments

Comments
 (0)