ata/pata_arasan_cf: Add Hibernation support
authorViresh Kumar <viresh.kumar@st.com>
Thu, 23 Feb 2012 09:33:53 +0000 (15:03 +0530)
committerJeff Garzik <jgarzik@redhat.com>
Tue, 13 Mar 2012 16:43:13 +0000 (12:43 -0400)
This patch adds in Hibernation related callbacks. Also we don't really need to
free DMA channel on suspend.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/pata_arasan_cf.c

index 048589f..fc2db2a 100644 (file)
@@ -925,11 +925,10 @@ static int arasan_cf_suspend(struct device *dev)
        struct ata_host *host = dev_get_drvdata(dev);
        struct arasan_cf_dev *acdev = host->ports[0]->private_data;
 
-       if (acdev->dma_chan) {
+       if (acdev->dma_chan)
                acdev->dma_chan->device->device_control(acdev->dma_chan,
                                DMA_TERMINATE_ALL, 0);
-               dma_release_channel(acdev->dma_chan);
-       }
+
        cf_exit(acdev);
        return ata_host_suspend(host, PMSG_SUSPEND);
 }
@@ -945,10 +944,7 @@ static int arasan_cf_resume(struct device *dev)
        return 0;
 }
 
-static const struct dev_pm_ops arasan_cf_pm_ops = {
-       .suspend        = arasan_cf_suspend,
-       .resume         = arasan_cf_resume,
-};
+static SIMPLE_DEV_PM_OPS(arasan_cf_pm_ops, arasan_cf_suspend, arasan_cf_resume);
 #endif
 
 static struct platform_driver arasan_cf_driver = {
@@ -958,7 +954,7 @@ static struct platform_driver arasan_cf_driver = {
                .name   = DRIVER_NAME,
                .owner  = THIS_MODULE,
 #ifdef CONFIG_PM
-               .pm             = &arasan_cf_pm_ops,
+               .pm     = &arasan_cf_pm_ops,
 #endif
        },
 };