From patchwork Fri Oct 30 09:27:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vimal singh X-Patchwork-Id: 37266 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.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 CFFA71007D1 for ; Fri, 30 Oct 2009 20:30:02 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1N3nmC-0001bY-VI; Fri, 30 Oct 2009 09:28:08 +0000 Received: from mail-bw0-f212.google.com ([209.85.218.212]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1N3nm6-0001a0-F2 for linux-mtd@lists.infradead.org; Fri, 30 Oct 2009 09:28:07 +0000 Received: by bwz4 with SMTP id 4so3673723bwz.2 for ; Fri, 30 Oct 2009 02:28:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=6VE7LBV5KKTu7vjenqODKpiLsaN15YapcrXjqLDhk4s=; b=cBX+2rG6eyaN6wBsy5hC9AhNYD+4gjFyBqfwXeMmeH2Ypo87b7sYCh3yhmLX6kSape BYx/OeRcOiFs3oiheLUVKbpZZYQgk7YN25aO3pZbA/UN25oV+ABXnIzRKzKpy/nhFD/7 MixLtq6uAqRKH48FiuAFt4k/aE9C55peQOctc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=FGMerNcrg9S/7HQfLZOqFsjfEHqM7OJ7IMGK8zTM9eZGqyS0ubH7+pSs2ZryazBl4l RyUvwR8mIRUfFZ8aDnpbZUndaPTCPgKU26iW4uRXeLaT5vKS16+VPxSZdebnYo2rPV/j JOy/l8vml2Bqbc3s+jq5qlILtmUFARuPRt8bY= MIME-Version: 1.0 Received: by 10.204.162.143 with SMTP id v15mr939448bkx.50.1256894881096; Fri, 30 Oct 2009 02:28:01 -0700 (PDT) In-Reply-To: References: From: Vimal Singh Date: Fri, 30 Oct 2009 14:57:41 +0530 Message-ID: Subject: Re: [PATCH 2/3]NAND: OMAP: Fixing omap nand driver, compiled as module To: Linux MTD , linux-omap@vger.kernel.org X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20091030_052802_654295_BFEEB26A X-CRM114-Status: GOOD ( 11.04 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- _SUMMARY_ X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Last time I forgot to 'git add' for 'arch/arm/mach-omap2/gpmc.c'... My bad. Correct patch is below. -vimal From: Vimal Singh Date: Fri, 30 Oct 2009 14:54:29 +0530 Subject: [PATCH] NAND: OMAP: Fixing omap nand driver, compiled as module Removing OMAP NAND driver, when loaded as a module, gives error and does not get success. This fixes this and makes driver loadable and removable run time. Signed-off-by: Vimal Singh --- arch/arm/mach-omap2/gpmc.c | 2 ++ drivers/mtd/nand/omap2.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 1587682..1d10b7b 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -88,6 +88,7 @@ void gpmc_cs_write_reg(int cs, int idx, u32 val) reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx; __raw_writel(val, reg_addr); } +EXPORT_SYMBOL(gpmc_cs_write_reg); u32 gpmc_cs_read_reg(int cs, int idx) { @@ -96,6 +97,7 @@ u32 gpmc_cs_read_reg(int cs, int idx) reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx; return __raw_readl(reg_addr); } +EXPORT_SYMBOL(gpmc_cs_read_reg); /* TODO: Add support for gpmc_fck to clock framework and use it */ unsigned long gpmc_get_fclk_period(void) diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 92573d5..ecc4d32 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -1056,7 +1056,8 @@ out_free_info: static int omap_nand_remove(struct platform_device *pdev) { struct mtd_info *mtd = platform_get_drvdata(pdev); - struct omap_nand_info *info = mtd->priv; + struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, + mtd); platform_set_drvdata(pdev, NULL); if (use_dma) @@ -1064,7 +1065,9 @@ static int omap_nand_remove(struct platform_device *pdev) /* Release NAND device, its internal structures and partitions */ nand_release(&info->mtd); + release_mem_region(info->phys_base, NAND_IO_SIZE); iounmap(info->nand_pref_fifo_add); + gpmc_cs_free(info->gpmc_cs); kfree(&info->mtd); return 0; }