mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bryan Freed <bfreed@chromium.org>
To: linux-kernel@vger.kernel.org
Cc: jic23@cam.ac.uk, gregkh@suse.de, rklein@nvidia.com,
	linux-iio@vger.kernel.org, Bryan Freed <bfreed@chromium.org>
Subject: [PATCH v1 4/4] staging:iio:light:isl29018: Fix the "Init of isl29018 fails" failure.
Date: Thu,  7 Jul 2011 12:01:57 -0700	[thread overview]
Message-ID: <1310065317-3872-5-git-send-email-bfreed@chromium.org> (raw)
In-Reply-To: <1310065317-3872-1-git-send-email-bfreed@chromium.org>

The I2C clientdata is set to indio_dev instead of chip as of a couple weeks ago.
Correct the calls to i2c_get_clientdata() accordingly.
Otherwise the driver fails to initialize.

Signed-off-by: Bryan Freed <bfreed@chromium.org>
---
 drivers/staging/iio/light/isl29018.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
index 070e94d..426b6af 100644
--- a/drivers/staging/iio/light/isl29018.c
+++ b/drivers/staging/iio/light/isl29018.c
@@ -68,7 +68,7 @@ static int isl29018_write_data(struct i2c_client *client, u8 reg,
 {
 	u8 regval;
 	int ret = 0;
-	struct isl29018_chip *chip = i2c_get_clientdata(client);
+	struct isl29018_chip *chip = iio_priv(i2c_get_clientdata(client));
 
 	regval = chip->reg_cache[reg];
 	regval &= ~mask;
@@ -158,7 +158,7 @@ static int isl29018_read_sensor_input(struct i2c_client *client, int mode)
 static int isl29018_read_lux(struct i2c_client *client, int *lux)
 {
 	int lux_data;
-	struct isl29018_chip *chip = i2c_get_clientdata(client);
+	struct isl29018_chip *chip = iio_priv(i2c_get_clientdata(client));
 
 	lux_data = isl29018_read_sensor_input(client,
 				COMMMAND1_OPMODE_ALS_ONCE);
@@ -450,7 +450,7 @@ static const struct attribute_group isl29108_group = {
 
 static int isl29018_chip_init(struct i2c_client *client)
 {
-	struct isl29018_chip *chip = i2c_get_clientdata(client);
+	struct isl29018_chip *chip = iio_priv(i2c_get_clientdata(client));
 	int status;
 	int new_adc_bit;
 	unsigned int new_range;
-- 
1.7.3.1


      parent reply	other threads:[~2011-07-07 19:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-07 19:01 [PATCH 0/4] Apply these staging:iio patches to staging-next Bryan Freed
2011-07-07 19:01 ` [PATCH v2 1/4] staging:iio: Reorder channel type strings to match the iio.h enums Bryan Freed
2011-07-07 19:01 ` [PATCH v2 2/4] staging:iio: Add an iio channel type string to support proximity sensors Bryan Freed
2011-07-07 19:01 ` [PATCH v2 3/4] staging:iio:light:isl29018: Convert some of the isl29018 driver to the new iio_chan_spec framework Bryan Freed
2011-07-07 19:01 ` Bryan Freed [this message]

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=1310065317-3872-5-git-send-email-bfreed@chromium.org \
    --to=bfreed@chromium.org \
    --cc=gregkh@suse.de \
    --cc=jic23@cam.ac.uk \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rklein@nvidia.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®