diff mbox series

[v3,1/3] pwm: mtk_disp: clear the clock operations

Message ID 1617703062-4251-2-git-send-email-rex-bc.chen@mediatek.com (mailing list archive)
State New, archived
Headers show
Series Convert the mtk_disp driver to aotmic API | expand

Commit Message

Rex-BC Chen (陳柏辰) April 6, 2021, 9:57 a.m. UTC
Remove the clk_prepare from mtk_disp_pwm_probe.
Remove the clk_unprepare from mtk_disp_pwm_remove.

After using atomic API and get_state() function which are implemented in PATCH [2/3], [3/3],
clk_prepare/clk_unprepare are useless in probe/remove function.
So we remove clk_prepare/clk_unprepare in probe/remove fuinction.

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Signed-off-by: Jitao Shi <jitao.shi@mediatek.com>
---
 drivers/pwm/pwm-mtk-disp.c | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

Comments

Uwe Kleine-König April 6, 2021, 10:07 a.m. UTC | #1
Hello,

On Tue, Apr 06, 2021 at 05:57:40PM +0800, Rex-BC Chen wrote:
> Remove the clk_prepare from mtk_disp_pwm_probe.
> Remove the clk_unprepare from mtk_disp_pwm_remove.
> 
> After using atomic API and get_state() function which are implemented
> in PATCH [2/3], [3/3],

Refering to the following patches as 2/3 and 3/3 doesn't make sense once
these patches are applied to a tree.

> clk_prepare/clk_unprepare are useless in probe/remove function.
> So we remove clk_prepare/clk_unprepare in probe/remove fuinction.

Does the driver still work with only this patch applied? If not, please
rearrange and order this patch after the conversion to the atomic API.

Best regards
Uwe
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-mtk-disp.c b/drivers/pwm/pwm-mtk-disp.c
index 87c6b4bc5d43..21416a8b6b47 100644
--- a/drivers/pwm/pwm-mtk-disp.c
+++ b/drivers/pwm/pwm-mtk-disp.c
@@ -192,14 +192,6 @@  static int mtk_disp_pwm_probe(struct platform_device *pdev)
 	if (IS_ERR(mdp->clk_mm))
 		return PTR_ERR(mdp->clk_mm);
 
-	ret = clk_prepare(mdp->clk_main);
-	if (ret < 0)
-		return ret;
-
-	ret = clk_prepare(mdp->clk_mm);
-	if (ret < 0)
-		goto disable_clk_main;
-
 	mdp->chip.dev = &pdev->dev;
 	mdp->chip.ops = &mtk_disp_pwm_ops;
 	mdp->chip.base = -1;
@@ -208,7 +200,7 @@  static int mtk_disp_pwm_probe(struct platform_device *pdev)
 	ret = pwmchip_add(&mdp->chip);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
-		goto disable_clk_mm;
+		return ret;
 	}
 
 	platform_set_drvdata(pdev, mdp);
@@ -227,24 +219,13 @@  static int mtk_disp_pwm_probe(struct platform_device *pdev)
 	}
 
 	return 0;
-
-disable_clk_mm:
-	clk_unprepare(mdp->clk_mm);
-disable_clk_main:
-	clk_unprepare(mdp->clk_main);
-	return ret;
 }
 
 static int mtk_disp_pwm_remove(struct platform_device *pdev)
 {
 	struct mtk_disp_pwm *mdp = platform_get_drvdata(pdev);
-	int ret;
-
-	ret = pwmchip_remove(&mdp->chip);
-	clk_unprepare(mdp->clk_mm);
-	clk_unprepare(mdp->clk_main);
 
-	return ret;
+	return pwmchip_remove(&mdp->chip);
 }
 
 static const struct mtk_pwm_data mt2701_pwm_data = {