On Fri, 21 Jul 2017 00:24:21 +0900 Akinobu Mita <akinobu.mita@xxxxxxxxx> wrote: > pm_runtime_get_sync() and pm_runtime_put_autosuspend() return 0 on > success, 1 if the device's runtime PM status was already requested status > or error code on failure. So a positive return value doesn't indicate an > error condition. > > However, any non-zero return values from buffer preenable and postdisable > callbacks are recognized as an error and this driver reuses the return > value from pm_runtime_get_sync() and pm_runtime_put_autosuspend() in > these callbacks. This change fixes the false error detections. > > Cc: Daniel Baluta <daniel.baluta@xxxxxxxxx> > Cc: Jonathan Cameron <jic23@xxxxxxxxxx> > Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx> Applied to the togreg branch of iio.git and marked for stable. Thanks, Jonathan > --- > drivers/iio/adc/ti-ads1015.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c > index 8905f0d..1c475e2 100644 > --- a/drivers/iio/adc/ti-ads1015.c > +++ b/drivers/iio/adc/ti-ads1015.c > @@ -235,7 +235,7 @@ static int ads1015_set_power_state(struct ads1015_data *data, bool on) > ret = pm_runtime_put_autosuspend(dev); > } > > - return ret; > + return ret < 0 ? ret : 0; > } > > static -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html