All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mtd: pxa3xx_nand: don't duplicate MTD suspend/resume
@ 2015-10-12 20:33 Brian Norris
  2015-10-12 20:33 ` [PATCH 2/2] mtd: pxa3xx_nand: switch to device PM Brian Norris
  2015-10-15 18:33 ` [PATCH 1/2] mtd: pxa3xx_nand: don't duplicate MTD suspend/resume Ezequiel Garcia
  0 siblings, 2 replies; 11+ messages in thread
From: Brian Norris @ 2015-10-12 20:33 UTC (permalink / raw)
  To: linux-mtd; +Cc: Ezequiel Garcia, Brian Norris

mtd_{suspend,resume}() get called from mtdcore in a class suspend/resume
callback. We don't need to call them again here. In practice, this would
actually work OK, as nand_base actually handles nesting OK -- it just
might print warnings.

Untested, but there are few (no?) users of PM for this driver AFAIK.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/mtd/nand/pxa3xx_nand.c | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 232c7074624a..cce5a32eef60 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1892,32 +1892,19 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
 static int pxa3xx_nand_suspend(struct platform_device *pdev, pm_message_t state)
 {
 	struct pxa3xx_nand_info *info = platform_get_drvdata(pdev);
-	struct pxa3xx_nand_platform_data *pdata;
-	struct mtd_info *mtd;
-	int cs;
 
-	pdata = dev_get_platdata(&pdev->dev);
 	if (info->state) {
 		dev_err(&pdev->dev, "driver busy, state = %d\n", info->state);
 		return -EAGAIN;
 	}
 
-	for (cs = 0; cs < pdata->num_cs; cs++) {
-		mtd = info->host[cs]->mtd;
-		mtd_suspend(mtd);
-	}
-
 	return 0;
 }
 
 static int pxa3xx_nand_resume(struct platform_device *pdev)
 {
 	struct pxa3xx_nand_info *info = platform_get_drvdata(pdev);
-	struct pxa3xx_nand_platform_data *pdata;
-	struct mtd_info *mtd;
-	int cs;
 
-	pdata = dev_get_platdata(&pdev->dev);
 	/* We don't want to handle interrupt without calling mtd routine */
 	disable_int(info, NDCR_INT_MASK);
 
@@ -1935,10 +1922,6 @@ static int pxa3xx_nand_resume(struct platform_device *pdev)
 	 * all status before resume
 	 */
 	nand_writel(info, NDSR, NDSR_MASK);
-	for (cs = 0; cs < pdata->num_cs; cs++) {
-		mtd = info->host[cs]->mtd;
-		mtd_resume(mtd);
-	}
 
 	return 0;
 }
-- 
2.6.0.rc2.230.g3dd15c0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-10-20 19:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-12 20:33 [PATCH 1/2] mtd: pxa3xx_nand: don't duplicate MTD suspend/resume Brian Norris
2015-10-12 20:33 ` [PATCH 2/2] mtd: pxa3xx_nand: switch to device PM Brian Norris
2015-10-12 21:07   ` Brian Norris
2015-10-15 18:32     ` Ezequiel Garcia
2015-10-16 15:24       ` Ezequiel Garcia
2015-10-16 16:35         ` Brian Norris
2015-10-15 18:33 ` [PATCH 1/2] mtd: pxa3xx_nand: don't duplicate MTD suspend/resume Ezequiel Garcia
2015-10-16 15:26   ` Ezequiel Garcia
2015-10-16 16:37     ` Brian Norris
2015-10-16 16:50       ` Ezequiel Garcia
2015-10-20 19:33   ` Robert Jarzmik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.