From patchwork Tue Jan 20 07:33:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 19444 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BB38FDDF04 for ; Tue, 20 Jan 2009 18:59:58 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1LPBVL-0004sl-8x; Tue, 20 Jan 2009 07:58:35 +0000 Received: from 89.6b.364a.static.theplanet.com ([74.54.107.137] helo=cathcart.site5.com) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1LPB7T-0002Fu-Nw for linux-mtd@lists.infradead.org; Tue, 20 Jan 2009 07:34:00 +0000 Received: from mail.linux-boards.com ([192.114.83.142]) by cathcart.site5.com with esmtpsa (TLSv1:DES-CBC3-SHA:168) (Exim 4.69) (envelope-from ) id 1LPB7R-0007VT-Rg; Tue, 20 Jan 2009 01:33:54 -0600 Received: from gentoodev.compulab.local (mike-pc.compulab.local [10.1.1.95]) by mail.linux-boards.com (8.12.5/8.12.8) with ESMTP id n0K7XqgC015529; Tue, 20 Jan 2009 09:33:52 +0200 Received: from gentoodev.compulab.local (localhost [127.0.0.1]) by gentoodev.compulab.local (8.14.0/8.14.0) with ESMTP id n0K7XpoF015209; Tue, 20 Jan 2009 09:33:51 +0200 Received: (from mike@localhost) by gentoodev.compulab.local (8.14.0/8.14.0/Submit) id n0K7Xpg8015208; Tue, 20 Jan 2009 09:33:51 +0200 X-Authentication-Warning: gentoodev.compulab.local: mike set sender to mike@compulab.co.il using -f From: Mike Rapoport To: eric.miao@marvell.com Subject: [PATCH] MTD: NAND: pxa3xx_nand: allow building as module Date: Tue, 20 Jan 2009 09:33:47 +0200 Message-Id: <1232436828-15176-3-git-send-email-mike@compulab.co.il> X-Mailer: git-send-email 1.5.6.4 In-Reply-To: <1232436828-15176-2-git-send-email-mike@compulab.co.il> References: <1232436828-15176-1-git-send-email-mike@compulab.co.il> <1232436828-15176-2-git-send-email-mike@compulab.co.il> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cathcart.site5.com X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - compulab.co.il X-Source: X-Source-Args: X-Source-Dir: X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. X-Spam-Score: 0.0 (/) X-Mailman-Approved-At: Tue, 20 Jan 2009 02:58:33 -0500 Cc: linux-mtd@lists.infradead.org, linux-arm-kernel@lists.arm.linux.org.uk, ben-linux@fluff.org, Mike Rapoport X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.9 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 Signed-off-by: Mike Rapoport --- drivers/mtd/nand/Kconfig | 2 +- drivers/mtd/nand/pxa3xx_nand.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index 8b12e6e..d3966d0 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig @@ -334,7 +334,7 @@ config MTD_NAND_ATMEL_ECC_NONE endchoice config MTD_NAND_PXA3xx - bool "Support for NAND flash devices on PXA3xx" + tristate "Support for NAND flash devices on PXA3xx" depends on MTD_NAND && PXA3xx help This enables the driver for the NAND flash device found on diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index ffa960b..ead4a7a 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1079,6 +1079,7 @@ static int pxa3xx_nand_probe(struct platform_device *pdev) this = &info->nand_chip; mtd->priv = info; + mtd->owner = THIS_MODULE; info->clk = clk_get(&pdev->dev, NULL); if (IS_ERR(info->clk)) { @@ -1187,6 +1188,7 @@ static int pxa3xx_nand_remove(struct platform_device *pdev) { struct mtd_info *mtd = platform_get_drvdata(pdev); struct pxa3xx_nand_info *info = mtd->priv; + struct resource *r; platform_set_drvdata(pdev, NULL); @@ -1199,6 +1201,14 @@ static int pxa3xx_nand_remove(struct platform_device *pdev) info->data_buff, info->data_buff_phys); } else kfree(info->data_buff); + + iounmap(info->mmio_base); + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); + release_mem_region(r->start, resource_size(r)); + + clk_disable(info->clk); + clk_put(info->clk); + kfree(mtd); return 0; }