lkml.org 
[lkml]   [2022]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH linux-next] gnss:using the pm_runtime_resume_and_get to simplify the code
Date
From: ye xingchen <ye.xingchen@zte.com.cn>

Using pm_runtime_resume_and_get() to instade of pm_runtime_get_sync
and pm_runtime_put_noidle.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
drivers/gnss/serial.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gnss/serial.c b/drivers/gnss/serial.c
index 5d8e9bfb24d0..71feca5eb70b 100644
--- a/drivers/gnss/serial.c
+++ b/drivers/gnss/serial.c
@@ -32,9 +32,8 @@ 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);
+ ret = pm_runtime_resume_and_get(&serdev->dev);
if (ret < 0) {
- pm_runtime_put_noidle(&serdev->dev);
goto err_close;
}

--
2.25.1
\
 
 \ /
  Last update: 2022-08-02 09:45    [W:0.027 / U:0.916 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site