]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: magnetometer: ak8975: Add missed pm_runtime_put_autosuspend() call
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 6 May 2026 08:27:55 +0000 (10:27 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2026 09:59:35 +0000 (10:59 +0100)
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 <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260505-magnetometer-fixes-v5-0-831b9b5550fc%40gmail.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/magnetometer/ak8975.c

index 44782c26698bcac5ebfc62ce3740f361078fd0ce..e70101abfcd309797c9589d9b5f151c0950f8196 100644 (file)
@@ -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;
 }