Skip to contentSkip to conversation

gnss: serial: Use pm_runtime_resume_and_get()

PATCH New [email protected] 1 participant 2 messages Sep 24 Gnss

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 gnss: serial: Use pm_runtime_resume_and_get()

From: bui duc phuc <[email protected]>

Replace the open-coded pm_runtime_get_sync() + pm_runtime_put_noidle() error handling pattern with pm_runtime_resume_and_get(), which already does this internally.

No functional change.

---
 drivers/gnss/serial.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gnss/serial.c +2 -4
index 0e43bf6294f8..ae26b3915621 100644
@@ -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;
 
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/2 gnss: sirf: Use pm_runtime_resume_and_get()

From: bui duc phuc <[email protected]>

Replace the open-coded pm_runtime_get_sync() + pm_runtime_put_noidle() error handling pattern with pm_runtime_resume_and_get(), which already does this internally.

No functional change.

---
 drivers/gnss/sirf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gnss/sirf.c +1 -2
index 79375d14bbb6..4a68055a237f 100644
@@ -103,10 +103,9 @@ static int sirf_open(struct gnss_device *gdev)
 		return ret;
 	}
 
-	ret = pm_runtime_get_sync(&serdev->dev);
+	ret = pm_runtime_resume_and_get(&serdev->dev);
 	if (ret < 0) {
 		dev_err(&gdev->dev, "failed to runtime resume: %d\n", ret);
-		pm_runtime_put_noidle(&serdev->dev);
 		goto err_close;
 	}
 
Signature · 1 line
2.43.0