]> Pileus Git - ~andy/linux/blobdiff - drivers/usb/host/ohci-ppc-soc.c
[DRIVER MODEL] Convert platform drivers to use struct platform_driver
[~andy/linux] / drivers / usb / host / ohci-ppc-soc.c
index 92cf6f4a13748ad9535e47d2ce827c6618aa3f75..18755766e406c7ae674bec5e0a408638fd373805 100644 (file)
@@ -172,9 +172,8 @@ static const struct hc_driver ohci_ppc_soc_hc_driver = {
        .start_port_reset =     ohci_start_port_reset,
 };
 
-static int ohci_hcd_ppc_soc_drv_probe(struct device *dev)
+static int ohci_hcd_ppc_soc_drv_probe(struct platform_device *pdev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
        int ret;
 
        if (usb_disabled())
@@ -184,25 +183,25 @@ static int ohci_hcd_ppc_soc_drv_probe(struct device *dev)
        return ret;
 }
 
-static int ohci_hcd_ppc_soc_drv_remove(struct device *dev)
+static int ohci_hcd_ppc_soc_drv_remove(struct platform_device *pdev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct usb_hcd *hcd = dev_get_drvdata(dev);
+       struct usb_hcd *hcd = platform_get_drvdata(dev);
 
        usb_hcd_ppc_soc_remove(hcd, pdev);
        return 0;
 }
 
-static struct device_driver ohci_hcd_ppc_soc_driver = {
-       .name           = "ppc-soc-ohci",
-       .owner          = THIS_MODULE,
-       .bus            = &platform_bus_type,
+static struct platform_driver ohci_hcd_ppc_soc_driver = {
        .probe          = ohci_hcd_ppc_soc_drv_probe,
        .remove         = ohci_hcd_ppc_soc_drv_remove,
 #ifdef CONFIG_PM
        /*.suspend      = ohci_hcd_ppc_soc_drv_suspend,*/
        /*.resume       = ohci_hcd_ppc_soc_drv_resume,*/
 #endif
+       .driver         = {
+               .name   = "ppc-soc-ohci",
+               .owner  = THIS_MODULE,
+       },
 };
 
 static int __init ohci_hcd_ppc_soc_init(void)
@@ -211,12 +210,12 @@ static int __init ohci_hcd_ppc_soc_init(void)
        pr_debug("block sizes: ed %d td %d\n", sizeof(struct ed),
                                                        sizeof(struct td));
 
-       return driver_register(&ohci_hcd_ppc_soc_driver);
+       return platform_driver_register(&ohci_hcd_ppc_soc_driver);
 }
 
 static void __exit ohci_hcd_ppc_soc_cleanup(void)
 {
-       driver_unregister(&ohci_hcd_ppc_soc_driver);
+       platform_driver_unregister(&ohci_hcd_ppc_soc_driver);
 }
 
 module_init(ohci_hcd_ppc_soc_init);