OSDN Git Service

media: mtk-mdp: handle vpu_wdt_reg_handler() errors during probe
authorEizan Miyamoto <eizan@chromium.org>
Thu, 7 May 2020 10:23:46 +0000 (12:23 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 4 Jul 2020 10:00:21 +0000 (12:00 +0200)
This is a cleanup to better handle errors during MDP probe.

Signed-off-by: Eizan Miyamoto <eizan@chromium.org>
Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/mtk-mdp/mtk_mdp_core.c

index 9b24b8d..17d1552 100644 (file)
@@ -188,8 +188,12 @@ static int mtk_mdp_probe(struct platform_device *pdev)
        }
 
        mdp->vpu_dev = vpu_get_plat_device(pdev);
-       vpu_wdt_reg_handler(mdp->vpu_dev, mtk_mdp_reset_handler, mdp,
-                           VPU_RST_MDP);
+       ret = vpu_wdt_reg_handler(mdp->vpu_dev, mtk_mdp_reset_handler, mdp,
+                                 VPU_RST_MDP);
+       if (ret) {
+               dev_err(&pdev->dev, "Failed to register reset handler\n");
+               goto err_m2m_register;
+       }
 
        platform_set_drvdata(pdev, mdp);