From: Johan Hovold <johan@kernel.org>
To: cgel.zte@gmail.com
Cc: linux-kernel@vger.kernel.org,
Minghao Chi <chi.minghao@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] gnss: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync
Date: Wed, 20 Apr 2022 10:03:08 +0200 [thread overview]
Message-ID: <Yl++PMZWWwZkbVUg@hovoldconsulting.com> (raw)
In-Reply-To: <20220419110642.2574612-1-chi.minghao@zte.com.cn>
On Tue, Apr 19, 2022 at 11:06:42AM +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/gnss/serial.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gnss/serial.c b/drivers/gnss/serial.c
> index 5d8e9bfb24d0..afa7a08d718e 100644
> --- a/drivers/gnss/serial.c
> +++ b/drivers/gnss/serial.c
> @@ -32,11 +32,9 @@ static int gnss_serial_open(struct gnss_device *gdev)
> serdev_device_set_baudrate(serdev, gserial->speed);
> serdev_device_set_flow_control(serdev, false);
>
> - ret = pm_runtime_get_sync(&serdev->dev);
> - if (ret < 0) {
> - pm_runtime_put_noidle(&serdev->dev);
> + ret = pm_runtime_resume_and_get(&serdev->dev);
> + if (ret < 0)
> goto err_close;
> - }
>
> return 0;
Same comments apply here:
https://lore.kernel.org/lkml/Yl+948unOoDFdLe2@hovoldconsulting.com/T/#t
Johan
prev parent reply other threads:[~2022-04-20 8:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-19 11:06 cgel.zte
2022-04-20 8:03 ` Johan Hovold [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=Yl++PMZWWwZkbVUg@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=cgel.zte@gmail.com \
--cc=chi.minghao@zte.com.cn \
--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
Powered by JetHome