* [PATCH] driver core: Use pm_runtime_resume_and_get() instead of open-coding it
@ 2026-09-21 2:24 phucduc.bui
0 siblings, 0 replies; only message in thread
From: phucduc.bui @ 2026-09-21 2:24 UTC (permalink / raw)
To: Greg Kroah-Hartman, rafael, Danilo Krummrich
Cc: driver-core, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
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@gmail.com>
---
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-21 2:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-21 2:24 [PATCH] driver core: Use pm_runtime_resume_and_get() instead of open-coding it phucduc.bui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®