Skip to content

Commit

Permalink
staging: iio: isl29018: change isl29018_read_raw() to only have one e…
Browse files Browse the repository at this point in the history
…xit 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>
  • Loading branch information
Brian Masney authored and Jonathan Cameron committed Oct 1, 2016
1 parent 5faf98c commit 5611cd6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/staging/iio/light/isl29018.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -438,6 +438,8 @@ static int isl29018_read_raw(struct iio_dev *indio_dev,
default:
break;
}

read_done:
mutex_unlock(&chip->lock);
return ret;
}
Expand Down

0 comments on commit 5611cd6

Please sign in to comment.