linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: cgel.zte@gmail.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Minghao Chi <chi.minghao@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] input: omap4-keypad: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
Date: Sun, 24 Apr 2022 20:54:50 -0700	[thread overview]
Message-ID: <YmYbihgXZTs9pgOg@google.com> (raw)
In-Reply-To: <20220414085710.2541867-1-chi.minghao@zte.com.cn>

On Thu, Apr 14, 2022 at 08:57:10AM +0000, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
> pm_runtime_put_noidle. This change is just to simplify the code, no
> actual functional changes.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
>  drivers/input/keyboard/omap4-keypad.c | 21 +++++++--------------
>  1 file changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
> index 43375b38ee59..df6ab8006807 100644
> --- a/drivers/input/keyboard/omap4-keypad.c
> +++ b/drivers/input/keyboard/omap4-keypad.c
> @@ -179,11 +179,9 @@ static irqreturn_t omap4_keypad_irq_thread_fn(int irq, void *dev_id)
>  	int error;
>  	u64 keys;
>  
> -	error = pm_runtime_get_sync(dev);
> -	if (error < 0) {
> -		pm_runtime_put_noidle(dev);
> +	error = pm_runtime_resume_and_get(dev);
> +	if (error < 0)

pm_runtime_resume_and_get() returns 0 or negative error, so we can
simplify the check to "if (error)".

I adjusted locally and applied, thank you.

-- 
Dmitry

      reply	other threads:[~2022-04-25  3:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14  8:57 [PATCH] input: omap4-keypad: using pm_runtime_resume_and_get instead of pm_runtime_get_sync cgel.zte
2022-04-25  3:54 ` Dmitry Torokhov [this message]

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=YmYbihgXZTs9pgOg@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=cgel.zte@gmail.com \
    --cc=chi.minghao@zte.com.cn \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zealci@zte.com.cn \
    /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;
as well as URLs for NNTP newsgroup(s).