diff mbox

[3/3] spi: sirf: use SET_SYSTEM_SLEEP_PM_OPS to initialize PM entries

Message ID 1392222620-17273-3-git-send-email-21cnbao@gmail.com (mailing list archive)
State Accepted
Commit facffed29709313593e6feab3a08d9664874e977
Delegated to: Mark Brown
Headers show

Commit Message

Barry Song Feb. 12, 2014, 4:30 p.m. UTC
From: Qipan Li <Qipan.Li@csr.com>

use SET_SYSTEM_SLEEP_PM_OPS to initialize PM entries, this makes the codes
clean and also enable the ability of hibernation support for sirf SPI.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
---
 drivers/spi/spi-sirf.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Comments

Mark Brown Feb. 24, 2014, 2:01 a.m. UTC | #1
On Thu, Feb 13, 2014 at 12:30:20AM +0800, Barry Song wrote:
> From: Qipan Li <Qipan.Li@csr.com>
> 
> use SET_SYSTEM_SLEEP_PM_OPS to initialize PM entries, this makes the codes
> clean and also enable the ability of hibernation support for sirf SPI.

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index a213e87..5bffa5f 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -739,7 +739,7 @@  static int  spi_sirfsoc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int spi_sirfsoc_suspend(struct device *dev)
 {
 	struct spi_master *master = dev_get_drvdata(dev);
@@ -762,12 +762,11 @@  static int spi_sirfsoc_resume(struct device *dev)
 
 	return 0;
 }
+#endif
 
 static const struct dev_pm_ops spi_sirfsoc_pm_ops = {
-	.suspend = spi_sirfsoc_suspend,
-	.resume = spi_sirfsoc_resume,
+	SET_SYSTEM_SLEEP_PM_OPS(spi_sirfsoc_suspend, spi_sirfsoc_resume)
 };
-#endif
 
 static const struct of_device_id spi_sirfsoc_of_match[] = {
 	{ .compatible = "sirf,prima2-spi", },
@@ -780,9 +779,7 @@  static struct platform_driver spi_sirfsoc_driver = {
 	.driver = {
 		.name = DRIVER_NAME,
 		.owner = THIS_MODULE,
-#ifdef CONFIG_PM
 		.pm     = &spi_sirfsoc_pm_ops,
-#endif
 		.of_match_table = spi_sirfsoc_of_match,
 	},
 	.probe = spi_sirfsoc_probe,