Skip to contentSkip to conversation

media: exynos4-is: add missed clk_disable_unprepare in remove

PATCH In review Chuhong Yuan 3 participants 3 messages Dec 19, 2019 – Jan 13, 2020

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

PATCH v2 1/1 media: exynos4-is: add missed clk_disable_unprepare in remove

This driver forgets to disable and unprepare clock when remove. Add a call to clk_disable_unprepare() to fix it.

---
Changes in v2:
- Add a check of pm_runtime_enable() to match enable in probe.
- Add RFT tag.

 drivers/media/platform/exynos4-is/fimc-lite.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/media/platform/exynos4-is/fimc-lite.c +3 -0
index e87c6a09205b..17de14fbba31 100644
@@ -1614,6 +1614,9 @@ static int fimc_lite_remove(struct platform_device *pdev)
 	struct fimc_lite *fimc = platform_get_drvdata(pdev);
 	struct device *dev = &pdev->dev;
 
+	if (!pm_runtime_enabled(dev))
+		clk_disable_unprepare(fimc->clock);
+
 	pm_runtime_disable(dev);
 	pm_runtime_set_suspended(dev);
 	fimc_lite_unregister_capture_subdev(fimc);
Signature · 1 line
2.24.0
#1 lore raw

Anyone able/willing to test this patch?

Regards,

Hans

Quoted 27 lines · Chuhong Yuan

This driver forgets to disable and unprepare clock when remove. Add a call to clk_disable_unprepare() to fix it.

---
Changes in v2:
- Add a check of pm_runtime_enable() to match enable in probe.
- Add RFT tag.

 drivers/media/platform/exynos4-is/fimc-lite.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/media/platform/exynos4-is/fimc-lite.c +3 -0
index e87c6a09205b..17de14fbba31 100644
@@ -1614,6 +1614,9 @@ static int fimc_lite_remove(struct platform_device *pdev)
 	struct fimc_lite *fimc = platform_get_drvdata(pdev);
 	struct device *dev = &pdev->dev;
 
+	if (!pm_runtime_enabled(dev))
+		clk_disable_unprepare(fimc->clock);
+
 	pm_runtime_disable(dev);
 	pm_runtime_set_suspended(dev);
 	fimc_lite_unregister_capture_subdev(fimc);
maintainer Reviewed-by
#2 lore raw
Quoted 1 line · Hans Verkuil

Anyone able/willing to test this patch?

I do not have the hardware with FIMC/camera so I cannot provide testing. However it looks good, so I propose to just take it:

Best regards,
Krzysztof