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: 56584 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9U9S3a5028404 for ; Fri, 30 Oct 2009 09:28:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756623AbZJ3J16 (ORCPT ); Fri, 30 Oct 2009 05:27:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756396AbZJ3J15 (ORCPT ); Fri, 30 Oct 2009 05:27:57 -0400 Received: from mail-bw0-f227.google.com ([209.85.218.227]:55518 "EHLO mail-bw0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755003AbZJ3J15 (ORCPT ); Fri, 30 Oct 2009 05:27:57 -0400 Received: by bwz27 with SMTP id 27so3307948bwz.21 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 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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; }