All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giorgio Dal Molin <giorgio.nicole@arcor.de>
To: linux-iio@vger.kernel.org
Cc: Giorgio Dal Molin <giorgio.nicole@arcor.de>, jic23@jic23.retrosnub.co.uk
Subject: [PATCH 1/1] iio:ti-ads1015: fix a wrong pointer definition.
Date: Tue, 16 Aug 2016 20:43:37 +0200	[thread overview]
Message-ID: <20160816184337.17059-1-giorgio.nicole@arcor.de> (raw)
In-Reply-To: <CAKzfze9e3U5MjgbwQYn7_APnvDMJpX8ORrstsASrrbN6bp5UOg@mail.gmail.com>

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>
---
 drivers/iio/adc/ti-ads1015.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
index 1ef39877..066abaf 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 = {
 #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 ||
-- 
2.9.3


  reply	other threads:[~2016-08-16 18:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28 22:40 [PATCH] iio: adc: ti-ads1015: fix incorrect referencing of ads1015_data pointer Matt Ranostay
2016-07-29  6:19 ` Daniel Baluta
2016-07-29  7:39   ` Matt Ranostay
2016-08-16 18:43     ` Giorgio Dal Molin [this message]
2016-08-21 10:01       ` [PATCH 1/1] iio:ti-ads1015: fix a wrong pointer definition Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2016-07-27 21:27 Giorgio
2016-08-15 17:49 ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160816184337.17059-1-giorgio.nicole@arcor.de \
    --to=giorgio.nicole@arcor.de \
    --cc=jic23@jic23.retrosnub.co.uk \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.