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

mfd: twl6040: Disable and unprepare clk32k in twl6040_power() error path

The clk32k clock is prepared and enabled in twl6040_power() but the clock
is left enabled in case of an error while it should be disable/unprepared.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Javier Martinez Canillas and committed by
Lee Jones
d6441dc5 32852bca

+2
+2
drivers/mfd/twl6040.c
··· 304 304 /* use automatic power-up sequence */ 305 305 ret = twl6040_power_up_automatic(twl6040); 306 306 if (ret) { 307 + clk_disable_unprepare(twl6040->clk32k); 307 308 twl6040->power_count = 0; 308 309 goto out; 309 310 } ··· 312 311 /* use manual power-up sequence */ 313 312 ret = twl6040_power_up_manual(twl6040); 314 313 if (ret) { 314 + clk_disable_unprepare(twl6040->clk32k); 315 315 twl6040->power_count = 0; 316 316 goto out; 317 317 }