From patchwork Fri Oct 30 08:42:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vimal singh X-Patchwork-Id: 37261 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 AF509B7C35 for ; Fri, 30 Oct 2009 19:44:47 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1N3n4V-0005Z9-Kh; Fri, 30 Oct 2009 08:42:59 +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 1N3n4N-0005C0-Qv for linux-mtd@lists.infradead.org; Fri, 30 Oct 2009 08:42:56 +0000 Received: by mail-bw0-f212.google.com with SMTP id 4so3633358bwz.2 for ; Fri, 30 Oct 2009 01:42:51 -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=TgN58aw1EZeQCFgd+NJ4nMS0avL3iifitb0OMuOz6M4=; b=AypYbukF1kqZeXG1BSagRJrVt1SCSSivDsHSEDuW6UXHvzZipZ6saVSXW81rJN9Qyp 1dNA/adLwjh87vCUtWldRzZxhe60iNOpaQ1hc4MOlXLjooElKf844JbFVTFnYIPMOdex q3ObBLoWNB1yrALCkiwInFL0JvmLOOmKM1Das= 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=epv3o3Mf6Q9qwcXsHAWT8bSMtN24CYe7qM9e+q2tNc4pkq1KQjN9rCOkm+3UGr9bq7 AY/9fiXVLKYGrbyq4SUiEUSTak8wlHDlbkx6zPkCMzpt9+fbOKutgtvzH/z4k8QIueYh WBuSsQUAOUMEglMY2lm7mAEou21HyN1kXyEtI= MIME-Version: 1.0 Received: by 10.204.154.69 with SMTP id n5mr904938bkw.43.1256892171156; Fri, 30 Oct 2009 01:42:51 -0700 (PDT) In-Reply-To: References: From: Vimal Singh Date: Fri, 30 Oct 2009 14:12:31 +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_044252_110510_D6568F72 X-CRM114-Status: UNSURE ( 8.22 ) X-CRM114-Notice: Please train this message. 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 Looping Linux-omap mailing list. From: Vimal Singh Date: Fri, 30 Oct 2009 11:32:17 +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 --- drivers/mtd/nand/omap2.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) 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; }