Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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;
}