ahci_platform: add hibernation callbacks
authorShiraz Hashim <shiraz.hashim@st.com>
Fri, 16 Mar 2012 10:19:55 +0000 (15:49 +0530)
committerJeff Garzik <jgarzik@redhat.com>
Wed, 25 Jul 2012 19:31:08 +0000 (15:31 -0400)
Use existing suspend, resume implementation for hibernation callbacks.

Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/ahci_platform.c

index 9e419e1..09728e0 100644 (file)
@@ -15,6 +15,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>
@@ -271,13 +272,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", },
        { .compatible = "snps,spear-ahci", },
@@ -291,9 +289,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,
 };