From: Sylwester Nawrocki Date: Fri, 18 Jan 2013 16:52:38 +0000 (-0300) Subject: [media] s5p-csis: Fix clock handling on error path in probe() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8cd5d42ac6d75143ab4bf44a15f76245a7f6c884;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] s5p-csis: Fix clock handling on error path in probe() Move e_clkput label after the clk_disable() call so a not acquired clock is not attempted to be disabled. This fixes runtime warnings like: s5p-mipi-csis 11880000.csis: failed to get clock: sclk_csis ------------[ cut here ]------------ WARNING: at drivers/clk/clk.c:478 clk_disable+0x24/0x34() Modules linked in: [] (unwind_backtrace+0x0/0x13c) from [] (warn_slowpath_common+0x54/0x64) [] (warn_slowpath_common+0x54/0x64) from [] (warn_slowpath_null+0x1c/0x24) [] (warn_slowpath_null+0x1c/0x24) from [] (clk_disable+0x24/0x34) [] (clk_disable+0x24/0x34) from [] (s5pcsis_probe+0x25c/0x4c8) [] (s5pcsis_probe+0x25c/0x4c8) from [] (platform_drv_probe+0x18/0x1c) [] (platform_drv_probe+0x18/0x1c) from [] (driver_probe_device+0xa4/0x368) [] (driver_probe_device+0xa4/0x368) from [] (__driver_attach+0x8c/0x90) [] (__driver_attach+0x8c/0x90) from [] (bus_for_each_dev+0x60/0x8c) [] (bus_for_each_dev+0x60/0x8c) from [] (bus_add_driver+0x20c/0x2d4) [] (bus_add_driver+0x20c/0x2d4) from [] (driver_register+0x78/0x194) [] (driver_register+0x78/0x194) from [] (do_one_initcall+0x34/0x188) [] (do_one_initcall+0x34/0x188) from [] (kernel_init+0x180/0x2f0) [] (kernel_init+0x180/0x2f0) from [] (ret_from_fork+0x14/0x3c) ---[ end trace 0c5a55345c42530b ]--- Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/s5p-fimc/mipi-csis.c b/drivers/media/platform/s5p-fimc/mipi-csis.c index 1cc6501c213f..981863d05aaa 100644 --- a/drivers/media/platform/s5p-fimc/mipi-csis.c +++ b/drivers/media/platform/s5p-fimc/mipi-csis.c @@ -771,7 +771,7 @@ static int s5pcsis_probe(struct platform_device *pdev) 0, dev_name(&pdev->dev), state); if (ret) { dev_err(&pdev->dev, "Interrupt request failed\n"); - goto e_clkput; + goto e_clkdis; } v4l2_subdev_init(&state->sd, &s5pcsis_subdev_ops); @@ -789,7 +789,7 @@ static int s5pcsis_probe(struct platform_device *pdev) ret = media_entity_init(&state->sd.entity, CSIS_PADS_NUM, state->pads, 0); if (ret < 0) - goto e_clkput; + goto e_clkdis; /* This allows to retrieve the platform device id by the host driver */ v4l2_set_subdevdata(&state->sd, pdev); @@ -802,8 +802,9 @@ static int s5pcsis_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); return 0; -e_clkput: +e_clkdis: clk_disable(state->clock[CSIS_CLK_MUX]); +e_clkput: s5pcsis_clk_put(state); return ret; }