[v2,RFT] media: exynos4-is: add missed clk_disable_unprepare in remove
diff mbox series

Message ID 20191219074824.15047-1-hslester96@gmail.com
State New
Headers show
Series
  • [v2,RFT] media: exynos4-is: add missed clk_disable_unprepare in remove
Related show

Commit Message

Chuhong Yuan Dec. 19, 2019, 7:48 a.m. UTC
This driver forgets to disable and unprepare clock when remove.
Add a call to clk_disable_unprepare() to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
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(+)

Comments

Hans Verkuil Jan. 10, 2020, 1:40 p.m. UTC | #1
Anyone able/willing to test this patch?

Regards,

	Hans

On 12/19/19 8:48 AM, Chuhong Yuan wrote:
> This driver forgets to disable and unprepare clock when remove.
> Add a call to clk_disable_unprepare() to fix it.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
> 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(+)
> 
> diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
> index e87c6a09205b..17de14fbba31 100644
> --- a/drivers/media/platform/exynos4-is/fimc-lite.c
> +++ b/drivers/media/platform/exynos4-is/fimc-lite.c
> @@ -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);
>
Krzysztof Kozlowski Jan. 13, 2020, 7:52 a.m. UTC | #2
On Fri, Jan 10, 2020 at 02:40:21PM +0100, Hans Verkuil wrote:
> 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:
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

Patch
diff mbox series

diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
index e87c6a09205b..17de14fbba31 100644
--- a/drivers/media/platform/exynos4-is/fimc-lite.c
+++ b/drivers/media/platform/exynos4-is/fimc-lite.c
@@ -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);