Linux Samsung SOC development
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <snawrocki@kernel.org>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: linuxarm@huawei.com, mauro.chehab@huawei.com,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH 72/78] media: s3c-camif: use pm_runtime_resume_and_get()
Date: Sun, 25 Apr 2021 21:36:45 +0200	[thread overview]
Message-ID: <dfb7f44b-5848-b968-6479-a088e72f1a47@kernel.org> (raw)
In-Reply-To: <3cfe70dad65dc078a656458cb55087a5269e9cc3.1619191723.git.mchehab+huawei@kernel.org>

Hi Mauro,

On 24.04.2021 08:45, 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/platform/s3c-camif/camif-capture.c | 5 ++---
>   drivers/media/platform/s3c-camif/camif-core.c    | 5 +++--
>   2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c
> index 9ca49af29542..01fa08065ebc 100644
> --- a/drivers/media/platform/s3c-camif/camif-capture.c
> +++ b/drivers/media/platform/s3c-camif/camif-capture.c
> @@ -547,16 +547,15 @@ static int s3c_camif_open(struct file *file)
>   	if (ret < 0)
>   		goto unlock;
>   
> -	ret = pm_runtime_get_sync(camif->dev);
> +	ret = pm_runtime_resume_and_get(camif->dev);
>   	if (ret < 0)

> -		goto err_pm;
> +		goto unlock;

I think we don't need that label change, fh still needs to be released
in case of an error.

>   	ret = sensor_set_power(camif, 1);
>   	if (!ret)
>   		goto unlock;
>   
>   	pm_runtime_put(camif->dev);
> -err_pm:
>   	v4l2_fh_release(file);
>   unlock:
>   	mutex_unlock(&camif->lock);

--
Regards,
Sylwester

  reply	other threads:[~2021-04-25 19:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-24  6:44 [PATCH 00/78] media: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Mauro Carvalho Chehab
2021-04-24  6:44 ` [PATCH 07/78] media: s5p: fix pm_runtime_get_sync() usage count Mauro Carvalho Chehab
2021-04-24  6:45 ` [PATCH 57/78] media: exynos4-is: use pm_runtime_resume_and_get() Mauro Carvalho Chehab
2021-04-25 20:57   ` Sylwester Nawrocki
2021-04-26 13:12     ` Mauro Carvalho Chehab
2021-04-27  8:06       ` Sylwester Nawrocki
2021-04-24  6:45 ` [PATCH 58/78] media: exynos-gsc: " Mauro Carvalho Chehab
2021-04-27  8:18   ` Sylwester Nawrocki
2021-04-27  9:30     ` Mauro Carvalho Chehab
2021-04-27  9:42       ` Mauro Carvalho Chehab
2021-04-27 11:50         ` Sylwester Nawrocki
2021-04-28  7:13           ` Mauro Carvalho Chehab
2021-04-28  7:17             ` Mauro Carvalho Chehab
2021-04-28  8:27               ` Sylwester Nawrocki
2021-04-24  6:45 ` [PATCH 72/78] media: s3c-camif: " Mauro Carvalho Chehab
2021-04-25 19:36   ` Sylwester Nawrocki [this message]
2021-04-28 10:13 ` [PATCH 00/78] media: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dfb7f44b-5848-b968-6479-a088e72f1a47@kernel.org \
    --to=snawrocki@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mauro.chehab@huawei.com \
    --cc=mchehab+huawei@kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox