treewide: fix up files incorrectly marked executable
[platform/kernel/linux-rpi.git] / drivers / iio / health / afe4403.c
index d492138..b5f959b 100644 (file)
@@ -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;