Skip to contentSkip to conversation

driver core: Use pm_runtime_resume_and_get() instead of open-coding it

PATCH New [email protected] 1 participant 1 message Sep 21 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 driver core: Use pm_runtime_resume_and_get() instead of open-coding it

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.

Found by manual code inspection.

---
 drivers/base/core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/base/core.c +1 -3
index 4c0c373998a1..a54cfe48ec80 100644
@@ -817,10 +817,8 @@ struct device_link *device_link_add(struct device *consumer,
 		return NULL;
 
 	if (flags & DL_FLAG_PM_RUNTIME && flags & DL_FLAG_RPM_ACTIVE) {
-		if (pm_runtime_get_sync(supplier) < 0) {
-			pm_runtime_put_noidle(supplier);
+		if (pm_runtime_resume_and_get(supplier) < 0)
 			return NULL;
-		}
 	}
 
 	if (!(flags & DL_FLAG_STATELESS))
Signature · 1 line
2.43.0