Re: [PATCH] tty: serdev: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 18, 2022 at 11:06:35AM +0000, cgel.zte@xxxxxxxxx wrote:
> From: Minghao Chi <chi.minghao@xxxxxxxxxx>
> 
> Using pm_runtime_resume_and_get is more appropriate
> for simplifing code
> 
> Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
> Signed-off-by: Minghao Chi <chi.minghao@xxxxxxxxxx>
> ---
>  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;
> -	}

As the author of this piece of the code, I prefer using the traditional
API consistently rather than mixing in the new helper that uses a
different naming scheme.

No need to change this.

>  
>  	return 0;

Johan



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux