diff options
-rw-r--r-- | drivers/mtd/onenand/onenand_base.c | 7 | ||||
-rw-r--r-- | drivers/mtd/onenand/samsung.c | 13 |
2 files changed, 6 insertions, 14 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index 3aa99af..f55190a 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c @@ -992,7 +992,7 @@ static int onenand_get_device(struct mtd_info *mtd, int new_state) schedule(); remove_wait_queue(&this->wq, &wait); } - if (this->clk) + if (this->clk && new_state != FL_PM_SUSPENDED) clk_enable(this->clk); return 0; } @@ -1007,6 +1007,9 @@ static void onenand_release_device(struct mtd_info *mtd) { struct onenand_chip *this = mtd->priv; + if (this->clk && this->state != FL_PM_SUSPENDED) + clk_disable(this->clk); + if (this->state != FL_PM_SUSPENDED && this->disable) this->disable(mtd); /* Release the chip */ @@ -1014,8 +1017,6 @@ static void onenand_release_device(struct mtd_info *mtd) this->state = FL_READY; wake_up(&this->wq); spin_unlock(&this->chip_lock); - if (this->clk) - clk_disable(this->clk); } /** diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c index 7ed1051..9532cc9 100644 --- a/drivers/mtd/onenand/samsung.c +++ b/drivers/mtd/onenand/samsung.c @@ -1220,28 +1220,19 @@ static int __devexit s3c_onenand_remove(struct platform_device *pdev) return 0; } -static int s3c_pm_ops_suspend(struct device *dev) -{ - struct platform_device *pdev = to_platform_device(dev); - struct mtd_info *mtd = platform_get_drvdata(pdev); - struct onenand_chip *this = mtd->priv; - - this->wait(mtd, FL_PM_SUSPENDED); - return 0; -} - static int s3c_pm_ops_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct mtd_info *mtd = platform_get_drvdata(pdev); struct onenand_chip *this = mtd->priv; + clk_enable(this->clk); this->unlock_all(mtd); + clk_disable(this->clk); return 0; } static const struct dev_pm_ops s3c_pm_ops = { - .suspend = s3c_pm_ops_suspend, .resume = s3c_pm_ops_resume, }; |