[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <027d86485fd1e65e2d3c8ef94b5fb5ba25536c91.camel@intel.com>
Date: Mon, 26 Apr 2021 09:06:54 +0000
From: "Alessandrelli, Daniele" <daniele.alessandrelli@...el.com>
To: "mchehab+huawei@...nel.org" <mchehab+huawei@...nel.org>
CC: "linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
"Krasteva, MartinaX" <martinax.krasteva@...el.com>,
"linuxarm@...wei.com" <linuxarm@...wei.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Murphy, Paul J" <paul.j.murphy@...el.com>,
"mchehab@...nel.org" <mchehab@...nel.org>,
"mauro.chehab@...wei.com" <mauro.chehab@...wei.com>,
"Rosikopulos, GjorgjiX" <gjorgjix.rosikopulos@...el.com>
Subject: Re: [PATCH 36/78] media: i2c: imx334: use pm_runtime_resume_and_get()
Hi Mauro,
Thanks for the patch.
On Sat, 2021-04-24 at 08:44 +0200, Mauro Carvalho Chehab wrote:
> Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to
> deal with usage counter")
> added pm_runtime_resume_and_get() in order to automatically handle
> dev->power.usage_count decrement on errors.
>
> Use the new API, in order to cleanup the error check logic.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
> ---
> drivers/media/i2c/imx334.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c
> index 047aa7658d21..a5a03bb4a6ae 100644
> --- a/drivers/media/i2c/imx334.c
> +++ b/drivers/media/i2c/imx334.c
> @@ -717,9 +717,9 @@ static int imx334_set_stream(struct v4l2_subdev
> *sd, int enable)
> }
>
> if (enable) {
> - ret = pm_runtime_get_sync(imx334->dev);
> + ret = pm_runtime_resume_and_get(imx334->dev);
> if (ret)
> - goto error_power_off;
> + goto error_unlock;
>
> ret = imx334_start_streaming(imx334);
> if (ret)
> @@ -737,6 +737,7 @@ static int imx334_set_stream(struct v4l2_subdev
> *sd, int enable)
>
> error_power_off:
> pm_runtime_put(imx334->dev);
> +error_unlock:
> mutex_unlock(&imx334->mutex);
>
> return ret;
Looks good to me.
Reviewed-by: Daniele Alessandrelli <daniele.alessandrelli@...el.com>
Powered by blists - more mailing lists