Patchwork [resend] ata/ahci_platform: add hibernation callbacks

login
register
mail settings
Submitter Shiraz Hashim
Date March 16, 2012, 10:19 a.m.
Message ID <1331893195-27078-1-git-send-email-shiraz.hashim@st.com>
Download mbox | patch
Permalink /patch/147180/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Shiraz Hashim - March 16, 2012, 10:19 a.m.
Use existing suspend, resume implementation for hibernation callbacks.

Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com>
---
 drivers/ata/ahci_platform.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

Patch

diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index 2bbcbbe..4431c60 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -16,6 +16,7 @@ 
 #include <linux/kernel.h>
 #include <linux/gfp.h>
 #include <linux/module.h>
+#include <linux/pm.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/device.h>
@@ -286,13 +287,10 @@  static int ahci_resume(struct device *dev)
 
 	return 0;
 }
-
-static struct dev_pm_ops ahci_pm_ops = {
-	.suspend		= &ahci_suspend,
-	.resume			= &ahci_resume,
-};
 #endif
 
+SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_suspend, ahci_resume);
+
 static const struct of_device_id ahci_of_match[] = {
 	{ .compatible = "calxeda,hb-ahci", },
 	{},
@@ -305,9 +303,7 @@  static struct platform_driver ahci_driver = {
 		.name = "ahci",
 		.owner = THIS_MODULE,
 		.of_match_table = ahci_of_match,
-#ifdef CONFIG_PM
 		.pm = &ahci_pm_ops,
-#endif
 	},
 	.id_table	= ahci_devtype,
 };