Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bryan Freed and committed by
Greg Kroah-Hartman
152d52cf 6e882d47

+3 -3
+3 -3
drivers/staging/iio/light/isl29018.c
··· 68 68 { 69 69 u8 regval; 70 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 73 regval = chip->reg_cache[reg]; 74 74 regval &= ~mask; ··· 158 158 static int isl29018_read_lux(struct i2c_client *client, int *lux) 159 159 { 160 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 163 lux_data = isl29018_read_sensor_input(client, 164 164 COMMMAND1_OPMODE_ALS_ONCE); ··· 466 466 467 467 static 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 470 int status; 471 471 int new_adc_bit; 472 472 unsigned int new_range;