| From | "Alessandrelli, Daniele" <> | Subject | Re: [PATCH 36/78] media: i2c: imx334: use pm_runtime_resume_and_get() | Date | Mon, 26 Apr 2021 09:06:54 +0000 |
| |
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@kernel.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@intel.com>
|