Skip to contentSkip to conversation

iio: magnetometer: ak8975: Add missed pm_runtime_put_autosuspend() call

PATCH In review Andy Shevchenko 4 participants 5 messages May 6 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/iio/magnetometer/ak8975.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/magnetometer/ak8975.c +1 -0
index b648b0afa573..b3468756bdf1 100644
@@ -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;
 }
Signature · 1 line
2.50.1
#1 lore raw
Quoted 2 lines · Andy Shevchenko

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.

I hope Jonathan will take this soon, so you, Joshua, can base a new version on this one (otherwise it will be a conflict with one change).

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Reviewed-by
#2 lore raw
Quoted 7 lines · Andy Shevchenko
Quoted 2 lines · Andy Shevchenko

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.

I hope Jonathan will take this soon, so you, Joshua, can base a new version on this one (otherwise it will be a conflict with one change).

Considering this is a fix, I'd say it will be merged fairly soon. I'll fix the addressed
changes, and then do a rebase once it's available.

Signature · 3 lines
Kind regards

CJD
maintainer
#3 lore raw
Quoted 7 lines · On Wed, 6 May 2026 10:45:56 +0200 Joshua Crofts <[email protected]>…
Quoted 5 lines · Andy Shevchenko
Quoted 2 lines · Andy Shevchenko

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.

Quoted 9 lines
Quoted 2 lines

I hope Jonathan will take this soon, so you, Joshua, can base a new version on this one (otherwise it will be a conflict with one change).

Considering this is a fix, I'd say it will be merged fairly soon. I'll fix the addressed
changes, and then do a rebase once it's available.

I'm going to be a tiny bit naughty with this one because I don't want to have your larger series sitting around for longer - my ability to keep up with what is in flight is failing me this week so I want to trim that down!

Snuck underneath the parts of your series I picked up on the testing branch of iio.git. It can get backported after next merge window.

Marked for stable.

Thanks

Jonathan

#4 lore raw
In reply to Andy Shevchenko
Quoted 12 lines · Andy Shevchenko

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")
---
 drivers/iio/magnetometer/ak8975.c | 1 +
 1 file changed, 1 insertion(+)

[snip]

Quoted 1 line

Looks fine to me but I'm not in a position to give a formal rb, as I can't compile-test it right now. If Jonathan gives it the green light then if he wants he can add my tag but that's at his discretion and not totally necessary since Joshua already gave his rb.

best regards,
max