Skip to content

Commit

Permalink
media: imx-mipi-csis: Fix clock handling in remove()
Browse files Browse the repository at this point in the history
The driver always calls mipi_csis_runtime_suspend() and
mipi_csis_clk_disable() in remove(). This causes multiple WARNs from the
kernel, as the clocks get disabled too many times.

Fix the remove() to call mipi_csis_runtime_suspend() and
mipi_csis_clk_disable() in a way that reverses what is done in probe().

Link: https://lore.kernel.org/r/[email protected]

Fixes: 7807063 ("media: staging/imx7: add MIPI CSI-2 receiver subdev for i.MX7")
Signed-off-by: Tomi Valkeinen <[email protected]>
Signed-off-by: Laurent Pinchart <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
tomba authored and mchehab committed Dec 9, 2023
1 parent 2a0ed5a commit 5705b0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/platform/nxp/imx-mipi-csis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1506,8 +1506,10 @@ static void mipi_csis_remove(struct platform_device *pdev)
v4l2_async_nf_cleanup(&csis->notifier);
v4l2_async_unregister_subdev(&csis->sd);

if (!pm_runtime_enabled(&pdev->dev))
mipi_csis_runtime_suspend(&pdev->dev);

pm_runtime_disable(&pdev->dev);
mipi_csis_runtime_suspend(&pdev->dev);
mipi_csis_clk_disable(csis);
v4l2_subdev_cleanup(&csis->sd);
media_entity_cleanup(&csis->sd.entity);
Expand Down

0 comments on commit 5705b0e

Please sign in to comment.