misc: sram: fix error path in sram_probe
From: Heiko Stuebner <heiko@...> Date: Mon, 24 Jun 2013 14:30:57 +0200
Commit-Message
The pool is created thru devm_gen_pool_create, so the call to gen_pool_destroy is not necessary. Instead the sram-clock must be turned off again if it exists. Signed-off-by: Heiko Stuebner <heiko@...>
Patch-Comment
drivers/misc/sram.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Statistics
- 2 lines added
- 1 lines removed
Changes
----------------------------- drivers/misc/sram.c ------------------------------
index d87cc91..afe66571 100644
@@ -68,7 +68,8 @@ static int sram_probe(struct platform_device *pdev)
ret = gen_pool_add_virt(sram->pool, (unsigned long)virt_base,
res->start, size, -1);
if (ret < 0) {
+ if (sram->clk)
+ clk_disable_unprepare(sram->clk);
return ret;
}