mtd: pxa3xx_nand: don't duplicate MTD suspend/resume

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 6 10:59:25 PST 2015


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=2e17497ccfdf0da39595eb98434fdbac93ad3f9b
Commit:     2e17497ccfdf0da39595eb98434fdbac93ad3f9b
Parent:     01a3c625766328200de1656915007537739847aa
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Mon Oct 12 13:33:11 2015 -0700
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Mon Oct 19 09:50:47 2015 -0700

    mtd: pxa3xx_nand: don't duplicate MTD suspend/resume
    
    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 at gmail.com>
    Tested-by: Ezequiel Garcia <ezequiel at vanguardiasur.com.ar>
    Acked-by: Ezequiel Garcia <ezequiel at vanguardiasur.com.ar>
---
 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 17d7a23..4abe755 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1893,32 +1893,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);
 
@@ -1936,10 +1923,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;
 }



More information about the linux-mtd-cvs mailing list