[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210623073549.24170-9-moudy.ho@mediatek.com>
Date: Wed, 23 Jun 2021 15:35:48 +0800
From: Moudy Ho <moudy.ho@...iatek.com>
To: Mauro Carvalho Chehab <mchehab@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Hans Verkuil <hverkuil-cisco@...all.nl>,
Jernej Skrabec <jernej.skrabec@...l.net>
CC: Maoguang Meng <maoguang.meng@...iatek.com>,
Krzysztof Kozlowski <krzk@...nel.org>,
daoyuan huang <daoyuan.huang@...iatek.com>,
Ping-Hsun Wu <ping-hsun.wu@...iatek.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Rob Landley <rob@...dley.net>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
<linux-media@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <tfiga@...omium.org>,
<drinkcat@...omium.org>, <acourbot@...omium.org>,
<pihsun@...omium.org>, <menghui.lin@...iatek.com>,
<sj.huang@...iatek.com>, <ben.lok@...iatek.com>,
<randy.wu@...iatek.com>, <moudy.ho@...iatek.com>,
<srv_heupstream@...iatek.com>, <frederic.chen@...iatek.com>
Subject: [RFC PATCH V0 09/10] media: mtk-mdp3: revise error handling about get/probe MDP3
This patch is used for review before send upstream patch.
>From Alexandre Courbot's review comment: Independent from the main patch.
Revise error handling about get/probe MDP3 driver to make it stable.
Signed-off-by: Moudy Ho <moudy.ho@...iatek.com>
---
drivers/media/platform/mtk-mdp3/mtk-mdp3-core.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/mtk-mdp3/mtk-mdp3-core.c b/drivers/media/platform/mtk-mdp3/mtk-mdp3-core.c
index eaf5b07e720f..207b55ace97b 100644
--- a/drivers/media/platform/mtk-mdp3/mtk-mdp3-core.c
+++ b/drivers/media/platform/mtk-mdp3/mtk-mdp3-core.c
@@ -40,9 +40,9 @@ struct platform_device *mdp_get_plat_device(struct platform_device *pdev)
}
mdp_pdev = of_find_device_by_node(mdp_node);
+ of_node_put(mdp_node);
if (WARN_ON(!mdp_pdev)) {
dev_err(dev, "mdp pdev failed\n");
- of_node_put(mdp_node);
return NULL;
}
@@ -113,7 +113,7 @@ static int mdp_probe(struct platform_device *pdev)
if (!mdp->job_wq) {
dev_err(dev, "Unable to create job workqueue\n");
ret = -ENOMEM;
- goto err_destroy_job_wq;
+ goto err_deinit_comp;
}
mdp->clock_wq = alloc_workqueue(MDP_MODULE_NAME "-clock", WQ_FREEZABLE,
@@ -121,7 +121,7 @@ static int mdp_probe(struct platform_device *pdev)
if (!mdp->clock_wq) {
dev_err(dev, "Unable to create clock workqueue\n");
ret = -ENOMEM;
- goto err_destroy_clock_wq;
+ goto err_destroy_job_wq;
}
mdp->scp = scp_get(pdev);
@@ -179,6 +179,8 @@ static int mdp_probe(struct platform_device *pdev)
destroy_workqueue(mdp->clock_wq);
err_destroy_job_wq:
destroy_workqueue(mdp->job_wq);
+err_deinit_comp:
+ mdp_component_deinit(mdp);
err_return:
dev_dbg(dev, "Errno %d\n", ret);
return ret;
--
2.18.0
Powered by blists - more mailing lists