lkml.org 
[lkml]   [2022]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] tty: serdev: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
From
On 18. 04. 22, 13:06, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
>
> Using pm_runtime_resume_and_get is more appropriate
> for simplifing code

... because it's helper doing exactly the same thing.

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>

> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
> drivers/tty/serdev/core.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
> index 0180e1e4e75d..e550ad3e7f2b 100644
> --- a/drivers/tty/serdev/core.c
> +++ b/drivers/tty/serdev/core.c
> @@ -156,11 +156,9 @@ int serdev_device_open(struct serdev_device *serdev)
> if (ret)
> return ret;
>
> - ret = pm_runtime_get_sync(&ctrl->dev);
> - if (ret < 0) {
> - pm_runtime_put_noidle(&ctrl->dev);
> + ret = pm_runtime_resume_and_get(&ctrl->dev);
> + if (ret < 0)
> goto err_close;
> - }
>
> return 0;
>


--
js
suse labs

\
 
 \ /
  Last update: 2022-04-19 10:00    [W:0.082 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site