Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc: imx: gpcv2: Fix clock disabling imbalance in error path

The imx_pgc_power_down() starts by enabling the domain clocks, and thus
disables them in the error path. Commit 18c98573a4cf ("soc: imx: gpcv2:
add domain option to keep domain clocks enabled") made the clock enable
conditional, but forgot to add the same condition to the error path.
This can result in a clock enable/disable imbalance. Fix it.

Fixes: 18c98573a4cf ("soc: imx: gpcv2: add domain option to keep domain clocks enabled")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>

authored by

Laurent Pinchart and committed by
Shawn Guo
fa231bef 45d941f6

+2 -1
+2 -1
drivers/soc/imx/gpcv2.c
··· 382 382 return 0; 383 383 384 384 out_clk_disable: 385 - clk_bulk_disable_unprepare(domain->num_clks, domain->clks); 385 + if (!domain->keep_clocks) 386 + clk_bulk_disable_unprepare(domain->num_clks, domain->clks); 386 387 387 388 return ret; 388 389 }