mirror of
https://github.com/torvalds/linux
synced 2024-10-22 19:25:51 +00:00
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>
This commit is contained in:
parent
6e882d472f
commit
152d52cf7e
|
@ -68,7 +68,7 @@ static int isl29018_write_data(struct i2c_client *client, u8 reg,
|
||||||
{
|
{
|
||||||
u8 regval;
|
u8 regval;
|
||||||
int ret = 0;
|
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 = chip->reg_cache[reg];
|
||||||
regval &= ~mask;
|
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)
|
static int isl29018_read_lux(struct i2c_client *client, int *lux)
|
||||||
{
|
{
|
||||||
int lux_data;
|
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,
|
lux_data = isl29018_read_sensor_input(client,
|
||||||
COMMMAND1_OPMODE_ALS_ONCE);
|
COMMMAND1_OPMODE_ALS_ONCE);
|
||||||
|
@ -466,7 +466,7 @@ static const struct attribute_group isl29108_group = {
|
||||||
|
|
||||||
static int isl29018_chip_init(struct i2c_client *client)
|
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 status;
|
||||||
int new_adc_bit;
|
int new_adc_bit;
|
||||||
unsigned int new_range;
|
unsigned int new_range;
|
||||||
|
|
Loading…
Reference in a new issue