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

memory: mvebu-devbus: Fix missing clk_disable_unprepare in mvebu_devbus_probe()

The clk_disable_unprepare() should be called in the error handling
of devbus_get_timing_params() and of_platform_populate(), fix it by
replacing devm_clk_get and clk_prepare_enable by devm_clk_get_enabled.

Fixes: e81b6abebc87 ("memory: add a driver for atmel ram controllers")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Link: https://lore.kernel.org/r/20221126044911.7226-1-cuigaosheng1@huawei.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

authored by

Gaosheng Cui and committed by
Krzysztof Kozlowski
cb8fd6f7 340cb392

+1 -2
+1 -2
drivers/memory/mvebu-devbus.c
··· 280 280 if (IS_ERR(devbus->base)) 281 281 return PTR_ERR(devbus->base); 282 282 283 - clk = devm_clk_get(&pdev->dev, NULL); 283 + clk = devm_clk_get_enabled(&pdev->dev, NULL); 284 284 if (IS_ERR(clk)) 285 285 return PTR_ERR(clk); 286 - clk_prepare_enable(clk); 287 286 288 287 /* 289 288 * Obtain clock period in picoseconds,