Skip to content

Commit 7892a1f

Browse files
geertumchehab
authored andcommitted
[media] rcar-fcp: Make sure rcar_fcp_enable() returns 0 on success
When resuming from suspend-to-RAM on r8a7795/salvator-x: dpm_run_callback(): pm_genpd_resume_noirq+0x0/0x90 returns 1 PM: Device fe940000.fdp1 failed to resume noirq: error 1 dpm_run_callback(): pm_genpd_resume_noirq+0x0/0x90 returns 1 PM: Device fe944000.fdp1 failed to resume noirq: error 1 dpm_run_callback(): pm_genpd_resume_noirq+0x0/0x90 returns 1 PM: Device fe948000.fdp1 failed to resume noirq: error 1 According to its documentation, rcar_fcp_enable() returns 0 on success or a negative error code if an error occurs. Hence fdp1_pm_runtime_resume() and vsp1_pm_runtime_resume() forward its return value to their callers. However, rcar_fcp_enable() forwards the return value of pm_runtime_get_sync(), which can actually be 1 on success, leading to the resume failure above. To fix this, consider only negative values returned by pm_runtime_get_sync() to be failures. Fixes: 7b49235 ("[media] v4l: Add Renesas R-Car FCP driver") Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 60815d4 commit 7892a1f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/media/platform/rcar-fcp.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,16 @@ EXPORT_SYMBOL_GPL(rcar_fcp_put);
9999
*/
100100
int rcar_fcp_enable(struct rcar_fcp_device *fcp)
101101
{
102+
int error;
103+
102104
if (!fcp)
103105
return 0;
104106

105-
return pm_runtime_get_sync(fcp->dev);
107+
error = pm_runtime_get_sync(fcp->dev);
108+
if (error < 0)
109+
return error;
110+
111+
return 0;
106112
}
107113
EXPORT_SYMBOL_GPL(rcar_fcp_enable);
108114

0 commit comments

Comments
 (0)