* [PATCH] gnss: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync
@ 2022-04-19 11:06 cgel.zte
2022-04-20 8:03 ` Johan Hovold
0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-04-19 11:06 UTC (permalink / raw)
To: johan; +Cc: linux-kernel, Minghao Chi, Zeal Robot
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;
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] gnss: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync
2022-04-19 11:06 [PATCH] gnss: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync cgel.zte
@ 2022-04-20 8:03 ` Johan Hovold
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hovold @ 2022-04-20 8:03 UTC (permalink / raw)
To: cgel.zte; +Cc: linux-kernel, Minghao Chi, Zeal Robot
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-20 8:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19 11:06 [PATCH] gnss: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync cgel.zte
2022-04-20 8:03 ` Johan Hovold
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