linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: eric@eukrea.com (Eric Bénard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly
Date: Thu, 17 Jun 2010 20:59:04 +0200	[thread overview]
Message-ID: <1276801147-4103-4-git-send-email-eric@eukrea.com> (raw)
In-Reply-To: <1276801147-4103-3-git-send-email-eric@eukrea.com>

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 <eric@eukrea.com>
Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-mtd at 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)
-- 
1.6.3.3

  reply	other threads:[~2010-06-17 18:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-17 18:59 [PATCH v2] input/imx_keypad: add PM support Eric Bénard
2010-06-17 18:59 ` [PATCH] eukrea_mbimx27: update keyboard platform data Eric Bénard
2010-06-17 18:59   ` [PATCH] eukrea_mbimx27-baseboard: fix compile when CONFIG_SPI_IMX is disabled Eric Bénard
2010-06-17 18:59     ` Eric Bénard [this message]
2010-06-17 18:59       ` [PATCH] video/imxfb: fix suspend when screen is blanked Eric Bénard
2010-06-17 18:59         ` [PATCH] mach-mx3/mach-mx31_3ds: update keypad registration Eric Bénard
2010-06-17 18:59           ` [PATCH] mxcmmc: convert to pm_ops and enable/disable clock Eric Bénard
2010-06-17 19:22         ` [PATCH] video/imxfb: fix suspend when screen is blanked Luotao Fu
2010-06-18  6:30           ` Eric Bénard
2010-07-07 14:17       ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Artem Bityutskiy
2010-07-17  7:24       ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend, resume} explicitly Eric Bénard
2010-07-17  7:33         ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Artem Bityutskiy
2010-07-17 12:49           ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend, resume} explicitly Eric Bénard
2010-07-17 15:13             ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Artem Bityutskiy
2010-06-18 10:16 ` [PATCH v2] input/imx_keypad: add PM support Alberto Panizzo
2010-06-18 14:37   ` Eric Bénard
2010-06-18 17:40     ` Alberto Panizzo
2010-06-18 17:50       ` Eric Bénard
2010-06-24 16:39 ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1276801147-4103-4-git-send-email-eric@eukrea.com \
    --to=eric@eukrea.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).