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

From: phucduc . bui

Date: Sun Sep 20 2026 - 22:24:55 EST


From: bui duc phuc <phucduc.bui@xxxxxxxxx>

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.

Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
drivers/base/core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 4c0c373998a1..a54cfe48ec80 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -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))
--
2.43.0