Commit 0df8baea authored by Shreeya Patel's avatar Shreeya Patel Committed by Jonathan Cameron

Staging: iio: adis16209: Adjust a switch statement

Adjust a switch block to explicitly match channels and
return -EINVAL as default case which makes the code
semantically more clear.
Signed-off-by: default avatarShreeya Patel <shreeya.patel23498@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 1026bb35
...@@ -155,10 +155,16 @@ static int adis16209_read_raw(struct iio_dev *indio_dev, ...@@ -155,10 +155,16 @@ static int adis16209_read_raw(struct iio_dev *indio_dev,
switch (chan->type) { switch (chan->type) {
case IIO_VOLTAGE: case IIO_VOLTAGE:
*val = 0; *val = 0;
if (chan->channel == 0) switch (chan->channel) {
case 0:
*val2 = 305180; /* 0.30518 mV */ *val2 = 305180; /* 0.30518 mV */
else break;
case 1:
*val2 = 610500; /* 0.6105 mV */ *val2 = 610500; /* 0.6105 mV */
break;
default:
return -EINVAL;
}
return IIO_VAL_INT_PLUS_MICRO; return IIO_VAL_INT_PLUS_MICRO;
case IIO_TEMP: case IIO_TEMP:
*val = -470; *val = -470;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment