Commit 5611cd6f authored by Brian Masney's avatar Brian Masney Committed by Jonathan Cameron

staging: iio: isl29018: change isl29018_read_raw() to only have one exit point

When the chip is in a suspended state, isl29018_read_raw() will return
-EBUSY. Change the function so that it only has a single exit point.
Signed-off-by: default avatarBrian Masney <masneyb@onstation.org>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 5faf98cb
...@@ -390,8 +390,8 @@ static int isl29018_read_raw(struct iio_dev *indio_dev, ...@@ -390,8 +390,8 @@ static int isl29018_read_raw(struct iio_dev *indio_dev,
mutex_lock(&chip->lock); mutex_lock(&chip->lock);
if (chip->suspended) { if (chip->suspended) {
mutex_unlock(&chip->lock); ret = -EBUSY;
return -EBUSY; goto read_done;
} }
switch (mask) { switch (mask) {
case IIO_CHAN_INFO_RAW: case IIO_CHAN_INFO_RAW:
...@@ -438,6 +438,8 @@ static int isl29018_read_raw(struct iio_dev *indio_dev, ...@@ -438,6 +438,8 @@ static int isl29018_read_raw(struct iio_dev *indio_dev,
default: default:
break; break;
} }
read_done:
mutex_unlock(&chip->lock); mutex_unlock(&chip->lock);
return ret; return ret;
} }
......
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