summaryrefslogtreecommitdiffstats
path: root/drivers/iio/magnetometer
diff options
context:
space:
mode:
authorPeter Meerwald <pmeerw@pmeerw.net>2014-02-25 20:53:00 +0100
committerJonathan Cameron <jic23@kernel.org>2014-02-25 21:45:58 +0100
commitb2addb4a112eb2fbf242558e01115b4ac2f6f13b (patch)
treebe6ff6562b54425b2383af1b681fed169021c8d0 /drivers/iio/magnetometer
parentMerge tag 'iio-for-3.15b' of git://git.kernel.org/pub/scm/linux/kernel/git/ji... (diff)
downloadlinux-b2addb4a112eb2fbf242558e01115b4ac2f6f13b.tar.xz
linux-b2addb4a112eb2fbf242558e01115b4ac2f6f13b.zip
iio:magnetometer:mag3110: Fix unreachable code
drivers/iio/magnetometer/mag3110.c:197 mag3110_read_raw() info: ignoring unreachable code. drivers/iio/magnetometer/mag3110.c 185 case IIO_CHAN_INFO_SCALE: 186 switch (chan->type) { 187 case IIO_MAGN: 188 *val = 0; 189 *val2 = 1000; 190 return IIO_VAL_INT_PLUS_MICRO; 191 case IIO_TEMP: 192 *val = 1000; 193 return IIO_VAL_INT; 194 default: 195 return -EINVAL; 196 } 197 return IIO_VAL_INT_PLUS_MICRO; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ introduced by f9279d3a, mag3110: Scale factor missing Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/magnetometer')
-rw-r--r--drivers/iio/magnetometer/mag3110.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/iio/magnetometer/mag3110.c b/drivers/iio/magnetometer/mag3110.c
index 02e4f9765889..8b77782474d7 100644
--- a/drivers/iio/magnetometer/mag3110.c
+++ b/drivers/iio/magnetometer/mag3110.c
@@ -194,7 +194,6 @@ static int mag3110_read_raw(struct iio_dev *indio_dev,
default:
return -EINVAL;
}
- return IIO_VAL_INT_PLUS_MICRO;
case IIO_CHAN_INFO_SAMP_FREQ:
i = data->ctrl_reg1 >> MAG3110_CTRL_DR_SHIFT;
*val = mag3110_samp_freq[i][0];