Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754273Ab3G2NLW (ORCPT ); Mon, 29 Jul 2013 09:11:22 -0400 Received: from gloria.sntech.de ([95.129.55.99]:41231 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751195Ab3G2NLV (ORCPT ); Mon, 29 Jul 2013 09:11:21 -0400 From: Heiko =?utf-8?q?St=C3=BCbner?= To: Arnd Bergmann Subject: [PATCH v4 1/6] misc: sram: fix error path in sram_probe Date: Mon, 29 Jul 2013 15:11:20 +0200 User-Agent: KMail/1.13.7 (Linux/3.2.0-2-amd64; KDE/4.8.4; x86_64; ; ) Cc: Olof Johansson , "linux-arm-kernel@lists.infradead.org" , Grant Likely , Rob Herring , devicetree-discuss@lists.ozlabs.org, Russell King , Philipp Zabel , linux-kernel@vger.kernel.org, "Greg Kroah-Hartman" , Ulrich Prinz References: <201307291510.31679.heiko@sntech.de> In-Reply-To: <201307291510.31679.heiko@sntech.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201307291511.21067.heiko@sntech.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1179 Lines: 36 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 Tested-by: Ulrich Prinz Acked-by: Philipp Zabel --- Only included for reference and completeness, as it is already added to the char-misc git tree. drivers/misc/sram.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c index d87cc91..afe66571 100644 --- a/drivers/misc/sram.c +++ b/drivers/misc/sram.c @@ -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) { - gen_pool_destroy(sram->pool); + if (sram->clk) + clk_disable_unprepare(sram->clk); return ret; } -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/