Skip to contentSkip to conversation

accel/rocket: Fix some error checking in rocket_core_init()

PATCH In review Dan Carpenter 2 participants 2 messages Aug 21, 2025 – Sep 1, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 accel/rocket: Fix some error checking in rocket_core_init()

The problem is that pm_runtime_get_sync() can return 1 on success so checking for zero doesn't work. Use the pm_runtime_resume_and_get() function instead. The pm_runtime_resume_and_get() function does additional cleanup as well so that's a bonus as well.

Fixes 0810d5ad88a1 ("accel/rocket: Add job submission IOCTL")
---
 drivers/accel/rocket/rocket_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/rocket/rocket_core.c +1 -1
index 72fb5e5798fa..abe7719c1db4 100644
@@ -74,7 +74,7 @@ int rocket_core_init(struct rocket_core *core)
 
 	pm_runtime_enable(dev);
 
-	err = pm_runtime_get_sync(dev);
+	err = pm_runtime_resume_and_get(dev);
 	if (err) {
 		rocket_job_fini(core);
 		return err;
Signature · 1 line
2.47.2
maintainer
#1 lore raw
Quoted 11 lines · Dan Carpenter

The problem is that pm_runtime_get_sync() can return 1 on success so checking for zero doesn't work. Use the pm_runtime_resume_and_get() function instead. The pm_runtime_resume_and_get() function does additional cleanup as well so that's a bonus as well.

Fixes 0810d5ad88a1 ("accel/rocket: Add job submission IOCTL")
---
 drivers/accel/rocket/rocket_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, Dan, I have applied it to drm-misc-next.

Regards,

Tomeu

Quoted 16 lines
drivers/accel/rocket/rocket_core.c +1 -2
index 72fb5e5798fa..abe7719c1db4 100644
@@ -74,7 +74,7 @@ int rocket_core_init(struct rocket_core *core)
 
        pm_runtime_enable(dev);
 
-       err = pm_runtime_get_sync(dev);
+       err = pm_runtime_resume_and_get(dev);
        if (err) {
                rocket_job_fini(core);
                return err;
--

2.47.2