From patchwork Thu Jun 17 18:59:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Benard X-Patchwork-Id: 56080 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 1905FB7D84 for ; Fri, 18 Jun 2010 05:01:23 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OPKJI-0005v5-9t; Thu, 17 Jun 2010 18:59:32 +0000 Received: from smtp3-g21.free.fr ([212.27.42.3]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OPKJB-0005so-LA; Thu, 17 Jun 2010 18:59:26 +0000 Received: from localhost.localdomain (tal33-3-82-233-81-124.fbx.proxad.net [82.233.81.124]) by smtp3-g21.free.fr (Postfix) with ESMTP id 05F1D818116; Thu, 17 Jun 2010 20:59:19 +0200 (CEST) From: =?utf-8?q?Eric=20B=C3=A9nard?= To: Subject: [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend, resume} explicitly Date: Thu, 17 Jun 2010 20:59:04 +0200 Message-Id: <1276801147-4103-4-git-send-email-eric@eukrea.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1276801147-4103-3-git-send-email-eric@eukrea.com> References: <1276801147-4103-1-git-send-email-eric@eukrea.com> <1276801147-4103-2-git-send-email-eric@eukrea.com> <1276801147-4103-3-git-send-email-eric@eukrea.com> MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100617_145926_148564_D50899F6 X-CRM114-Status: GOOD ( 12.50 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, low trust [212.27.42.3 listed in list.dnswl.org] Cc: Sascha Hauer , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org 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 The mtd layer is responsible to call mtd->{suspend,resume}. Doing it again in the driver is wrong and results in a warning: nand_resume called for a chip which is not in suspended state at resume time. Removing the calls from the resume and suspend functions makes them empty allowing them to be deleted completely. Signed-off-by: Eric Bénard Acked-by: Uwe Kleine-König Cc: Sascha Hauer Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mtd@lists.infradead.org --- v2: fix commit log (writen by Uwe Kleine-König) drivers/mtd/nand/mxc_nand.c | 44 +------------------------------------------ 1 files changed, 1 insertions(+), 43 deletions(-) diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 0d76b16..ad19dc6 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c @@ -873,53 +873,11 @@ static int __devexit mxcnd_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM -static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state) -{ - struct mtd_info *mtd = platform_get_drvdata(pdev); - struct nand_chip *nand_chip = mtd->priv; - struct mxc_nand_host *host = nand_chip->priv; - int ret = 0; - - DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n"); - - ret = mtd->suspend(mtd); - - /* - * nand_suspend locks the device for exclusive access, so - * the clock must already be off. - */ - BUG_ON(!ret && host->clk_act); - - return ret; -} - -static int mxcnd_resume(struct platform_device *pdev) -{ - struct mtd_info *mtd = platform_get_drvdata(pdev); - struct nand_chip *nand_chip = mtd->priv; - struct mxc_nand_host *host = nand_chip->priv; - int ret = 0; - - DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n"); - - mtd->resume(mtd); - - return ret; -} - -#else -# define mxcnd_suspend NULL -# define mxcnd_resume NULL -#endif /* CONFIG_PM */ - static struct platform_driver mxcnd_driver = { .driver = { .name = DRIVER_NAME, - }, + }, .remove = __devexit_p(mxcnd_remove), - .suspend = mxcnd_suspend, - .resume = mxcnd_resume, }; static int __init mxc_nd_init(void)