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>
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:
default:
break;
}
+
+read_done:
mutex_unlock(&chip->lock);
return ret;
}