Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757378Ab3GEMlH (ORCPT ); Fri, 5 Jul 2013 08:41:07 -0400 Received: from gloria.sntech.de ([95.129.55.99]:33593 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751162Ab3GEMlF (ORCPT ); Fri, 5 Jul 2013 08:41:05 -0400 From: Heiko =?utf-8?q?St=C3=BCbner?= To: Arnd Bergmann Subject: [PATCH v3 1/6] misc: sram: fix error path in sram_probe Date: Fri, 5 Jul 2013 14:40:53 +0200 User-Agent: KMail/1.13.7 (Linux/3.2.0-3-686-pae; KDE/4.8.4; i686; ; ) 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: <201307051440.19428.heiko@sntech.de> In-Reply-To: <201307051440.19428.heiko@sntech.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201307051440.53993.heiko@sntech.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1033 Lines: 32 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 --- 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/