From patchwork Fri Feb 17 14:49:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Walle X-Patchwork-Id: 141838 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (unknown [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 17F7CB6F9D for ; Sat, 18 Feb 2012 01:53:50 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1RyPAg-0004mc-ME; Fri, 17 Feb 2012 14:52:26 +0000 Received: from moutng.kundenserver.de ([212.227.126.186]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1RyPAa-0004lb-JZ; Fri, 17 Feb 2012 14:52:24 +0000 Received: from corscience.de (DSL01.212.114.252.242.ip-pool.NEFkom.net [212.114.252.242]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0M5IbP-1ShJFM2zGR-00yjYX; Fri, 17 Feb 2012 15:52:04 +0100 Received: from agamemnon.er.corscience.de (agamemnon.2og.er.corscience.de [192.168.102.104]) by corscience.de (Postfix) with ESMTP id 30E2C51EF2; Fri, 17 Feb 2012 15:52:03 +0100 (CET) From: Bernhard Walle To: dwmw2@infradead.org Subject: [PATCH] mtd: omap2: Release memory region in .remove function Date: Fri, 17 Feb 2012 15:49:32 +0100 Message-Id: <1329490172-8043-1-git-send-email-walle@corscience.de> X-Mailer: git-send-email 1.7.9.1 X-Provags-ID: V02:K0:oFooETUqHshyLaXowCnuzGnNFCPXInd5n4kEmcjpxpQ 9hzx6yG1GBeihtWHItZi3f5RBPMPG7p0aLmf/P7GnxuWqfBT+F Eq2/tADrvKFilwibE4ePwFpXBSkktXqSiioXupnQLB1psxMicm 4Bu0gfOUZ937a4k6KbZ3bFT26D5KwmzBItKI1Snggk18Es9pYw zHsXqT/18kQHTQNSbJMxono0xtWT5GiBXSOhhr6u3icFeDqHRC w+mJxdCQhGANlocUH0mlXqCHVr4vEf6jToUlJ6S+ejghcM2QYQ 9BIuhD6V8+Bf+PS7ZqmsG06a2SKM2uUtmvxVXf3LY7gy4rMlT/ OtvsjTGws3vSZEH/yHIxh0QygbW8Y8VaRTKOZRpVpwamkVnm1v BmFZOcY6/QR8A== 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 ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.186 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: tony@atomide.com, Artem.Bityutskiy@linux.intel.com, linux-kernel@vger.kernel.org, vimal.newwork@gmail.com, s-ghorai@ti.com, linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 When the driver is compiled as module, it's not possible to unload and reload the driver again: omap2-nand: probe of omap2-nand.0 failed with error -16 This patch fixes the problem because it releases the memory region, so that it can be requested again. Signed-off-by: Bernhard Walle Reviewed-by: Shubhrajyoti D --- drivers/mtd/nand/omap2.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index b3a883e..7dfcf68 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -1132,6 +1132,7 @@ static int omap_nand_remove(struct platform_device *pdev) /* Release NAND device, its internal structures and partitions */ nand_release(&info->mtd); iounmap(info->nand.IO_ADDR_R); + release_mem_region(info->phys_base, NAND_IO_SIZE); kfree(&info->mtd); return 0; }