aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Freed <bfreed@chromium.org>2011-07-07 15:01:57 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-07-08 17:11:48 -0400
commit152d52cf7ec18e655a2d5bb6a79d42e6e09d92d7 (patch)
tree067c5f00c0b4b4bc93bbdacd7ec7226f84a07d43
parent6e882d472f2b9fdfa4838317c9b67a64403fef73 (diff)
staging:iio:light:isl29018: Fix the "Init of isl29018 fails" failure.
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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/iio/light/isl29018.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
index cc6d71837e18..1e751459fbb5 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,
68{ 68{
69 u8 regval; 69 u8 regval;
70 int ret = 0; 70 int ret = 0;
71 struct isl29018_chip *chip = i2c_get_clientdata(client); 71 struct isl29018_chip *chip = iio_priv(i2c_get_clientdata(client));
72 72
73 regval = chip->reg_cache[reg]; 73 regval = chip->reg_cache[reg];
74 regval &= ~mask; 74 regval &= ~mask;
@@ -158,7 +158,7 @@ static int isl29018_read_sensor_input(struct i2c_client *client, int mode)
158static int isl29018_read_lux(struct i2c_client *client, int *lux) 158static int isl29018_read_lux(struct i2c_client *client, int *lux)
159{ 159{
160 int lux_data; 160 int lux_data;
161 struct isl29018_chip *chip = i2c_get_clientdata(client); 161 struct isl29018_chip *chip = iio_priv(i2c_get_clientdata(client));
162 162
163 lux_data = isl29018_read_sensor_input(client, 163 lux_data = isl29018_read_sensor_input(client,
164 COMMMAND1_OPMODE_ALS_ONCE); 164 COMMMAND1_OPMODE_ALS_ONCE);
@@ -466,7 +466,7 @@ static const struct attribute_group isl29108_group = {
466 466
467static int isl29018_chip_init(struct i2c_client *client) 467static int isl29018_chip_init(struct i2c_client *client)
468{ 468{
469 struct isl29018_chip *chip = i2c_get_clientdata(client); 469 struct isl29018_chip *chip = iio_priv(i2c_get_clientdata(client));
470 int status; 470 int status;
471 int new_adc_bit; 471 int new_adc_bit;
472 unsigned int new_range; 472 unsigned int new_range;