Skip to content

Commit

Permalink
memory: mvebu-devbus: Fix missing clk_disable_unprepare in mvebu_devb…
Browse files Browse the repository at this point in the history
…us_probe()

[ Upstream commit cb8fd6f ]

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: e81b6ab ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
gscui authored and gregkh committed Feb 1, 2023
1 parent 4c69fce commit 7003e0e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/memory/mvebu-devbus.c
Expand Up @@ -280,10 +280,9 @@ static int mvebu_devbus_probe(struct platform_device *pdev)
if (IS_ERR(devbus->base))
return PTR_ERR(devbus->base);

clk = devm_clk_get(&pdev->dev, NULL);
clk = devm_clk_get_enabled(&pdev->dev, NULL);
if (IS_ERR(clk))
return PTR_ERR(clk);
clk_prepare_enable(clk);

/*
* Obtain clock period in picoseconds,
Expand Down

0 comments on commit 7003e0e

Please sign in to comment.