diff options
author | Brian Masney <masneyb@onstation.org> | 2016-09-26 20:20:19 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-10-01 14:55:34 +0100 |
commit | 5611cd6fc61dbccdba61656bea9c5c1634b51e46 (patch) | |
tree | ccbb6088d3e514f9207862b5ce55ca4d0b634d90 /drivers | |
parent | 5faf98cb319bc7ce7cef080be1bbebba44233332 (diff) | |
download | linux-5611cd6fc61dbccdba61656bea9c5c1634b51e46.tar.bz2 |
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: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/iio/light/isl29018.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c index 990c6e52bafe..3a4d79d7e23c 100644 --- a/drivers/staging/iio/light/isl29018.c +++ b/drivers/staging/iio/light/isl29018.c @@ -390,8 +390,8 @@ static int isl29018_read_raw(struct iio_dev *indio_dev, mutex_lock(&chip->lock); if (chip->suspended) { - mutex_unlock(&chip->lock); - return -EBUSY; + ret = -EBUSY; + goto read_done; } switch (mask) { case IIO_CHAN_INFO_RAW: @@ -438,6 +438,8 @@ static int isl29018_read_raw(struct iio_dev *indio_dev, default: break; } + +read_done: mutex_unlock(&chip->lock); return ret; } |