mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-18 14:59:30 +00:00
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>
This commit is contained in:
parent
5faf98cb31
commit
5611cd6fc6
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue