[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250709165144.62c3cad9@jic23-huawei>
Date: Wed, 9 Jul 2025 16:51:44 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc: David Lechner <dlechner@...libre.com>, Nuno Sá
<nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>, Rui Miguel Silva
<rmfrfs@...il.com>, Linus Walleij <linus.walleij@...aro.org>, Julien
Stephan <jstephan@...libre.com>, Waqar Hameed <waqar.hameed@...s.com>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 06/12] iio: gyro: Remove redundant
pm_runtime_mark_last_busy() calls
On Wed, 9 Jul 2025 02:11:52 +0300
Sakari Ailus <sakari.ailus@...ux.intel.com> wrote:
> pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
> pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
> to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
> pm_runtime_mark_last_busy().
>
> Signed-off-by: Sakari Ailus <sakari.ailus@...ux.intel.com>
> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
> Reviewed-by: Rui Miguel Silva <rui.silva@...aro.org>
> ---
> drivers/iio/gyro/bmg160_core.c | 4 +---
> drivers/iio/gyro/fxas21002c_core.c | 2 --
> drivers/iio/gyro/mpu3050-core.c | 3 ---
> drivers/iio/gyro/mpu3050-i2c.c | 1 -
> 4 files changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c
> index 781d3e96645f..38394b5f3275 100644
> --- a/drivers/iio/gyro/bmg160_core.c
> +++ b/drivers/iio/gyro/bmg160_core.c
> @@ -309,10 +309,8 @@ static int bmg160_set_power_state(struct bmg160_data *data, bool on)
There are only two places where this actually takes a runtime variable on
value. So if you do introduce the helper Andy suggests then
only apply that in those two cases. Push the direct get/put down to the
call sites for all the others.
>
> if (on)
> ret = pm_runtime_get_sync(dev);
> - else {
> - pm_runtime_mark_last_busy(dev);
> + else
> ret = pm_runtime_put_autosuspend(dev);
> - }
>
> if (ret < 0) {
> dev_err(dev, "Failed: bmg160_set_power_state for %d\n", on);
Powered by blists - more mailing lists