NFS: Kill the obsolete NFS_PARANOIA
[powerpc.git] / drivers / pcmcia / omap_cf.c
index e65a6b8..2df216b 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/platform_device.h>
 #include <linux/errno.h>
 #include <linux/init.h>
@@ -203,15 +202,14 @@ static struct pccard_operations omap_cf_ops = {
  * "what chipselect is used".  Boards could want more.
  */
 
-static int __devinit omap_cf_probe(struct device *dev)
+static int __init omap_cf_probe(struct platform_device *pdev)
 {
        unsigned                seg;
        struct omap_cf_socket   *cf;
-       struct platform_device  *pdev = to_platform_device(dev);
        int                     irq;
        int                     status;
 
-       seg = (int) dev->platform_data;
+       seg = (int) pdev->dev.platform_data;
        if (seg == 0 || seg > 3)
                return -ENODEV;
 
@@ -228,7 +226,7 @@ static int __devinit omap_cf_probe(struct device *dev)
        cf->timer.data = (unsigned long) cf;
 
        cf->pdev = pdev;
-       dev_set_drvdata(dev, cf);
+       platform_set_drvdata(pdev, cf);
 
        /* this primarily just shuts up irq handling noise */
        status = request_irq(irq, omap_cf_irq, IRQF_SHARED,
@@ -292,7 +290,7 @@ static int __devinit omap_cf_probe(struct device *dev)
                omap_cf_present() ? "present" : "(not present)");
 
        cf->socket.owner = THIS_MODULE;
-       cf->socket.dev.dev = dev;
+       cf->socket.dev.parent = &pdev->dev;
        cf->socket.ops = &omap_cf_ops;
        cf->socket.resource_ops = &pccard_static_ops;
        cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP
@@ -319,9 +317,9 @@ fail0:
        return status;
 }
 
-static int __devexit omap_cf_remove(struct device *dev)
+static int __exit omap_cf_remove(struct platform_device *pdev)
 {
-       struct omap_cf_socket *cf = dev_get_drvdata(dev);
+       struct omap_cf_socket *cf = platform_get_drvdata(pdev);
 
        cf->active = 0;
        pcmcia_unregister_socket(&cf->socket);
@@ -333,26 +331,36 @@ static int __devexit omap_cf_remove(struct device *dev)
        return 0;
 }
 
-static struct device_driver omap_cf_driver = {
-       .name           = (char *) driver_name,
-       .bus            = &platform_bus_type,
-       .probe          = omap_cf_probe,
-       .remove         = __devexit_p(omap_cf_remove),
-       .suspend        = pcmcia_socket_dev_suspend,
-       .resume         = pcmcia_socket_dev_resume,
+static int omap_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
+{
+       return pcmcia_socket_dev_suspend(&pdev->dev, mesg);
+}
+
+static int omap_cf_resume(struct platform_device *pdev)
+{
+       return pcmcia_socket_dev_resume(&pdev->dev);
+}
+
+static struct platform_driver omap_cf_driver = {
+       .driver = {
+               .name   = (char *) driver_name,
+       },
+       .remove         = __exit_p(omap_cf_remove),
+       .suspend        = omap_cf_suspend,
+       .resume         = omap_cf_resume,
 };
 
 static int __init omap_cf_init(void)
 {
        if (cpu_is_omap16xx())
-               return driver_register(&omap_cf_driver);
+               return platform_driver_probe(&omap_cf_driver, omap_cf_probe);
        return -ENODEV;
 }
 
 static void __exit omap_cf_exit(void)
 {
        if (cpu_is_omap16xx())
-               driver_unregister(&omap_cf_driver);
+               platform_driver_unregister(&omap_cf_driver);
 }
 
 module_init(omap_cf_init);