X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=drivers%2Fiio%2Fhealth%2Fafe4403.c;h=b5f959bba42291b55475b691c3c1fcd55594d4f8;hb=a7d1a303ff0f90950b476c3285c4716f404eaa5d;hp=d4921385aaf7d6c31e6a6d71c814043016ef72f0;hpb=3cb5992c34f7a8693009f969b7d73b6b181ccc8e;p=platform%2Fkernel%2Flinux-rpi.git diff --git a/drivers/iio/health/afe4403.c b/drivers/iio/health/afe4403.c index d492138..b5f959b 100644 --- a/drivers/iio/health/afe4403.c +++ b/drivers/iio/health/afe4403.c @@ -245,14 +245,14 @@ static int afe4403_read_raw(struct iio_dev *indio_dev, int *val, int *val2, long mask) { struct afe4403_data *afe = iio_priv(indio_dev); - unsigned int reg = afe4403_channel_values[chan->address]; - unsigned int field = afe4403_channel_leds[chan->address]; + unsigned int reg, field; int ret; switch (chan->type) { case IIO_INTENSITY: switch (mask) { case IIO_CHAN_INFO_RAW: + reg = afe4403_channel_values[chan->address]; ret = afe4403_read(afe, reg, val); if (ret) return ret; @@ -262,6 +262,7 @@ static int afe4403_read_raw(struct iio_dev *indio_dev, case IIO_CURRENT: switch (mask) { case IIO_CHAN_INFO_RAW: + field = afe4403_channel_leds[chan->address]; ret = regmap_field_read(afe->fields[field], val); if (ret) return ret;