driver core: Use pm_runtime_resume_and_get() instead of open-coding it
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.
Signed-off-by bui duc phuc <[email protected]>
--- drivers/base/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/base/core.c +1 -3
@@ -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