From patchwork Fri Jan 20 10:35:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 136996 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7C8951007D5 for ; Fri, 20 Jan 2012 21:38:10 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1RoBpP-0005uW-3T; Fri, 20 Jan 2012 10:36:15 +0000 Received: from mo-p05-ob6.rzone.de ([2a01:238:20a:202:53f5::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RoBow-0005cf-Mh for linux-mtd@lists.infradead.org; Fri, 20 Jan 2012 10:35:52 +0000 X-RZG-AUTH: :IW0NeWC7b/q2i6W/qstXb1SBUuFnrGoheedClaTaNdBkW0QOb9J0FJuBIaIwrbMm X-RZG-CLASS-ID: mo05 Received: from kubuntu.fritz.box (p57B94C60.dip.t-dialin.net [87.185.76.96]) by post.strato.de (mrclete mo25) (RZmta 27.5 DYNA|AUTH) with ESMTPA id 200de0o0KACfnu ; Fri, 20 Jan 2012 11:35:29 +0100 (MET) From: Stefan Roese To: linux-mtd@lists.infradead.org, spear--sw-devel@lists.codex.cro.st.com Subject: [PATCH 1/1] mtd/spear_smi: release memory region during remove Date: Fri, 20 Jan 2012 11:35:19 +0100 Message-Id: <1327055719-17644-1-git-send-email-sr@denx.de> X-Mailer: git-send-email 1.7.8.4 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Shiraz Hashim , Artem Bityutskiy X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Shiraz Hashim Driver must cleanup all held resources during remove. It wasn't releasing requested memory region. Signed-off-by: Shiraz Hashim Signed-off-by: Stefan Roese Cc: Artem Bityutskiy --- Artem, this patch is a recent fixup to the new SMI driver, thats now sitting in your l2-mtd and linux-next git repo. Stefan drivers/mtd/devices/spear_smi.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c index db4b741..fdc5f0b 100644 --- a/drivers/mtd/devices/spear_smi.c +++ b/drivers/mtd/devices/spear_smi.c @@ -1032,6 +1032,7 @@ static int __devexit spear_smi_remove(struct platform_device *pdev) { struct spear_smi *dev; struct spear_snor_flash *flash; + struct resource *smi_base; int ret; int i, irq; @@ -1067,6 +1068,9 @@ static int __devexit spear_smi_remove(struct platform_device *pdev) clk_put(dev->clk); iounmap(dev->io_base); kfree(dev); + + smi_base = platform_get_resource(pdev, IORESOURCE_MEM, 0); + release_mem_region(smi_base->start, resource_size(smi_base)); platform_set_drvdata(pdev, NULL); return 0;