summaryrefslogtreecommitdiff
path: root/drivers/iio/chemical
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2020-05-31 06:02:08 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-06-14 11:49:14 +0100
commit68ba6eee8d9a6350711c980b9c7f62b1f134dab6 (patch)
treec4ab1dfdea7becad7aa03c28bb8142bc4b8c1c16 /drivers/iio/chemical
parent7d17577d49d68310aba991d7954b385478fda6c4 (diff)
iio: chemical: atlas-ezo-sensor: move ret variable scope in atlas_ezo_read_raw()
Move ret variable to the IIO_CHAN_INFO_RAW switch since currently only used within that scope. Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/chemical')
-rw-r--r--drivers/iio/chemical/atlas-ezo-sensor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/chemical/atlas-ezo-sensor.c b/drivers/iio/chemical/atlas-ezo-sensor.c
index f5a6d8ec6d4d..a94eb8a6bf32 100644
--- a/drivers/iio/chemical/atlas-ezo-sensor.c
+++ b/drivers/iio/chemical/atlas-ezo-sensor.c
@@ -69,13 +69,13 @@ static int atlas_ezo_read_raw(struct iio_dev *indio_dev,
{
struct atlas_ezo_data *data = iio_priv(indio_dev);
struct i2c_client *client = data->client;
- int ret = 0;
if (chan->type != IIO_CONCENTRATION)
return -EINVAL;
switch (mask) {
case IIO_CHAN_INFO_RAW: {
+ int ret;
long tmp;
mutex_lock(&data->lock);
@@ -110,7 +110,7 @@ static int atlas_ezo_read_raw(struct iio_dev *indio_dev,
return IIO_VAL_INT_PLUS_MICRO;
}
- return ret;
+ return 0;
}
static const struct iio_info atlas_info = {