From: Andy Shevchenko Date: Wed, 6 May 2026 08:27:55 +0000 (+0200) Subject: iio: magnetometer: ak8975: Add missed pm_runtime_put_autosuspend() call X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e94944d7364d3ddb273539492f9bd9c9a622549a;p=thirdparty%2Flinux.git iio: magnetometer: ak8975: Add missed pm_runtime_put_autosuspend() call On the failure in the ak8975_read_axis() the PM runtime gets unbalanced. Balance it by calling pm_runtime_put_autosuspend() on error path as well. Fixes: cde4cb5dd422 ("iio: magn: ak8975: deploy runtime and system PM") Reported-by: Sashiko Closes: https://sashiko.dev/#/patchset/20260505-magnetometer-fixes-v5-0-831b9b5550fc%40gmail.com Signed-off-by: Andy Shevchenko Reviewed-by: Joshua Crofts Cc: Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c index 44782c26698bc..e70101abfcd30 100644 --- a/drivers/iio/magnetometer/ak8975.c +++ b/drivers/iio/magnetometer/ak8975.c @@ -784,6 +784,7 @@ static int ak8975_read_axis(struct iio_dev *indio_dev, int index, int *val) exit: mutex_unlock(&data->lock); + pm_runtime_put_autosuspend(&data->client->dev); dev_err(&client->dev, "Error in reading axis\n"); return ret; }