aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorEric Bénard <eric@eukrea.com>2010-06-17 14:59:04 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-08-04 05:56:19 -0400
commit04dd0d3a9a33fdd8c3516db0fa85d9dba5610fc2 (patch)
treedefc1fbc8cdfad9da1fc08587ac3ad28320fb74a /drivers/mtd
parentc9fb67735b307a3cdf57e568b6c50c860248d1d3 (diff)
mtd: mxc_nand: dont call suspend and resume explicitly
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> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/mxc_nand.c43
1 files changed, 1 insertions, 42 deletions
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index b464f6b23d0d..e8dc6468f8bc 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -871,52 +871,11 @@ static int __devexit mxcnd_remove(struct platform_device *pdev)
871 return 0; 871 return 0;
872} 872}
873 873
874#ifdef CONFIG_PM
875static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state)
876{
877 struct mtd_info *mtd = platform_get_drvdata(pdev);
878 struct nand_chip *nand_chip = mtd->priv;
879 struct mxc_nand_host *host = nand_chip->priv;
880 int ret = 0;
881
882 DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n");
883
884 ret = mtd->suspend(mtd);
885
886 /*
887 * nand_suspend locks the device for exclusive access, so
888 * the clock must already be off.
889 */
890 BUG_ON(!ret && host->clk_act);
891
892 return ret;
893}
894
895static int mxcnd_resume(struct platform_device *pdev)
896{
897 struct mtd_info *mtd = platform_get_drvdata(pdev);
898 struct nand_chip *nand_chip = mtd->priv;
899 int ret = 0;
900
901 DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n");
902
903 mtd->resume(mtd);
904
905 return ret;
906}
907
908#else
909# define mxcnd_suspend NULL
910# define mxcnd_resume NULL
911#endif /* CONFIG_PM */
912
913static struct platform_driver mxcnd_driver = { 874static struct platform_driver mxcnd_driver = {
914 .driver = { 875 .driver = {
915 .name = DRIVER_NAME, 876 .name = DRIVER_NAME,
916 }, 877 },
917 .remove = __devexit_p(mxcnd_remove), 878 .remove = __devexit_p(mxcnd_remove),
918 .suspend = mxcnd_suspend,
919 .resume = mxcnd_resume,
920}; 879};
921 880
922static int __init mxc_nd_init(void) 881static int __init mxc_nd_init(void)