Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt/usb: Eliminate users of of_platform_{,un}register_driver

Get rid of users of of_platform_driver in drivers/usb. The
of_platform_{,un}register_driver functions are going away, so the
users need to be converted to using the platform_bus_type directly.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

+33 -41
+8 -6
drivers/usb/gadget/fsl_qe_udc.c
··· 2523 2523 } 2524 2524 2525 2525 /* Driver probe functions */ 2526 - static int __devinit qe_udc_probe(struct platform_device *ofdev, 2527 - const struct of_device_id *match) 2526 + static int __devinit qe_udc_probe(struct platform_device *ofdev) 2528 2527 { 2529 2528 struct device_node *np = ofdev->dev.of_node; 2530 2529 struct qe_ep *ep; 2531 2530 unsigned int ret = 0; 2532 2531 unsigned int i; 2533 2532 const void *prop; 2533 + 2534 + if (!ofdev->dev.of_match) 2535 + return -EINVAL; 2534 2536 2535 2537 prop = of_get_property(np, "mode", NULL); 2536 2538 if (!prop || strcmp(prop, "peripheral")) ··· 2545 2543 return -ENOMEM; 2546 2544 } 2547 2545 2548 - udc_controller->soc_type = (unsigned long)match->data; 2546 + udc_controller->soc_type = (unsigned long)ofdev->dev.of_match->data; 2549 2547 udc_controller->usb_regs = of_iomap(np, 0); 2550 2548 if (!udc_controller->usb_regs) { 2551 2549 ret = -ENOMEM; ··· 2770 2768 2771 2769 MODULE_DEVICE_TABLE(of, qe_udc_match); 2772 2770 2773 - static struct of_platform_driver udc_driver = { 2771 + static struct platform_driver udc_driver = { 2774 2772 .driver = { 2775 2773 .name = (char *)driver_name, 2776 2774 .owner = THIS_MODULE, ··· 2788 2786 { 2789 2787 printk(KERN_INFO "%s: %s, %s\n", driver_name, driver_desc, 2790 2788 DRIVER_VERSION); 2791 - return of_register_platform_driver(&udc_driver); 2789 + return platform_driver_register(&udc_driver); 2792 2790 } 2793 2791 2794 2792 static void __exit qe_udc_exit(void) 2795 2793 { 2796 - of_unregister_platform_driver(&udc_driver); 2794 + platform_driver_unregister(&udc_driver); 2797 2795 } 2798 2796 2799 2797 module_init(qe_udc_init);
+6 -6
drivers/usb/host/ehci-hcd.c
··· 1306 1306 #endif 1307 1307 1308 1308 #ifdef OF_PLATFORM_DRIVER 1309 - retval = of_register_platform_driver(&OF_PLATFORM_DRIVER); 1309 + retval = platform_driver_register(&OF_PLATFORM_DRIVER); 1310 1310 if (retval < 0) 1311 1311 goto clean3; 1312 1312 #endif 1313 1313 1314 1314 #ifdef XILINX_OF_PLATFORM_DRIVER 1315 - retval = of_register_platform_driver(&XILINX_OF_PLATFORM_DRIVER); 1315 + retval = platform_driver_register(&XILINX_OF_PLATFORM_DRIVER); 1316 1316 if (retval < 0) 1317 1317 goto clean4; 1318 1318 #endif 1319 1319 return retval; 1320 1320 1321 1321 #ifdef XILINX_OF_PLATFORM_DRIVER 1322 - /* of_unregister_platform_driver(&XILINX_OF_PLATFORM_DRIVER); */ 1322 + /* platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER); */ 1323 1323 clean4: 1324 1324 #endif 1325 1325 #ifdef OF_PLATFORM_DRIVER 1326 - of_unregister_platform_driver(&OF_PLATFORM_DRIVER); 1326 + platform_driver_unregister(&OF_PLATFORM_DRIVER); 1327 1327 clean3: 1328 1328 #endif 1329 1329 #ifdef PS3_SYSTEM_BUS_DRIVER ··· 1351 1351 static void __exit ehci_hcd_cleanup(void) 1352 1352 { 1353 1353 #ifdef XILINX_OF_PLATFORM_DRIVER 1354 - of_unregister_platform_driver(&XILINX_OF_PLATFORM_DRIVER); 1354 + platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER); 1355 1355 #endif 1356 1356 #ifdef OF_PLATFORM_DRIVER 1357 - of_unregister_platform_driver(&OF_PLATFORM_DRIVER); 1357 + platform_driver_unregister(&OF_PLATFORM_DRIVER); 1358 1358 #endif 1359 1359 #ifdef PLATFORM_DRIVER 1360 1360 platform_driver_unregister(&PLATFORM_DRIVER);
+3 -6
drivers/usb/host/ehci-ppc-of.c
··· 105 105 } 106 106 107 107 108 - static int __devinit 109 - ehci_hcd_ppc_of_probe(struct platform_device *op, const struct of_device_id *match) 108 + static int __devinit ehci_hcd_ppc_of_probe(struct platform_device *op) 110 109 { 111 110 struct device_node *dn = op->dev.of_node; 112 111 struct usb_hcd *hcd; ··· 254 255 } 255 256 256 257 257 - static int ehci_hcd_ppc_of_shutdown(struct platform_device *op) 258 + static void ehci_hcd_ppc_of_shutdown(struct platform_device *op) 258 259 { 259 260 struct usb_hcd *hcd = dev_get_drvdata(&op->dev); 260 261 261 262 if (hcd->driver->shutdown) 262 263 hcd->driver->shutdown(hcd); 263 - 264 - return 0; 265 264 } 266 265 267 266 ··· 272 275 MODULE_DEVICE_TABLE(of, ehci_hcd_ppc_of_match); 273 276 274 277 275 - static struct of_platform_driver ehci_hcd_ppc_of_driver = { 278 + static struct platform_driver ehci_hcd_ppc_of_driver = { 276 279 .probe = ehci_hcd_ppc_of_probe, 277 280 .remove = ehci_hcd_ppc_of_remove, 278 281 .shutdown = ehci_hcd_ppc_of_shutdown,
+2 -4
drivers/usb/host/ehci-xilinx-of.c
··· 142 142 /** 143 143 * ehci_hcd_xilinx_of_probe - Probe method for the USB host controller 144 144 * @op: pointer to the platform_device bound to the host controller 145 - * @match: pointer to of_device_id structure, not used 146 145 * 147 146 * This function requests resources and sets up appropriate properties for the 148 147 * host controller. Because the Xilinx USB host controller can be configured 149 148 * as HS only or HS/FS only, it checks the configuration in the device tree 150 149 * entry, and sets an appropriate value for hcd->has_tt. 151 150 */ 152 - static int __devinit 153 - ehci_hcd_xilinx_of_probe(struct platform_device *op, const struct of_device_id *match) 151 + static int __devinit ehci_hcd_xilinx_of_probe(struct platform_device *op) 154 152 { 155 153 struct device_node *dn = op->dev.of_node; 156 154 struct usb_hcd *hcd; ··· 286 288 }; 287 289 MODULE_DEVICE_TABLE(of, ehci_hcd_xilinx_of_match); 288 290 289 - static struct of_platform_driver ehci_hcd_xilinx_of_driver = { 291 + static struct platform_driver ehci_hcd_xilinx_of_driver = { 290 292 .probe = ehci_hcd_xilinx_of_probe, 291 293 .remove = ehci_hcd_xilinx_of_remove, 292 294 .shutdown = ehci_hcd_xilinx_of_shutdown,
+4 -5
drivers/usb/host/fhci-hcd.c
··· 561 561 .hub_control = fhci_hub_control, 562 562 }; 563 563 564 - static int __devinit of_fhci_probe(struct platform_device *ofdev, 565 - const struct of_device_id *ofid) 564 + static int __devinit of_fhci_probe(struct platform_device *ofdev) 566 565 { 567 566 struct device *dev = &ofdev->dev; 568 567 struct device_node *node = dev->of_node; ··· 811 812 }; 812 813 MODULE_DEVICE_TABLE(of, of_fhci_match); 813 814 814 - static struct of_platform_driver of_fhci_driver = { 815 + static struct platform_driver of_fhci_driver = { 815 816 .driver = { 816 817 .name = "fsl,usb-fhci", 817 818 .owner = THIS_MODULE, ··· 823 824 824 825 static int __init fhci_module_init(void) 825 826 { 826 - return of_register_platform_driver(&of_fhci_driver); 827 + return platform_driver_register(&of_fhci_driver); 827 828 } 828 829 module_init(fhci_module_init); 829 830 830 831 static void __exit fhci_module_exit(void) 831 832 { 832 - of_unregister_platform_driver(&of_fhci_driver); 833 + platform_driver_unregister(&of_fhci_driver); 833 834 } 834 835 module_exit(fhci_module_exit); 835 836
+4 -5
drivers/usb/host/isp1760-if.c
··· 27 27 #endif 28 28 29 29 #ifdef CONFIG_PPC_OF 30 - static int of_isp1760_probe(struct platform_device *dev, 31 - const struct of_device_id *match) 30 + static int of_isp1760_probe(struct platform_device *dev) 32 31 { 33 32 struct usb_hcd *hcd; 34 33 struct device_node *dp = dev->dev.of_node; ··· 118 119 }; 119 120 MODULE_DEVICE_TABLE(of, of_isp1760_match); 120 121 121 - static struct of_platform_driver isp1760_of_driver = { 122 + static struct platform_driver isp1760_of_driver = { 122 123 .driver = { 123 124 .name = "nxp-isp1760", 124 125 .owner = THIS_MODULE, ··· 397 398 if (!ret) 398 399 any_ret = 0; 399 400 #ifdef CONFIG_PPC_OF 400 - ret = of_register_platform_driver(&isp1760_of_driver); 401 + ret = platform_driver_register(&isp1760_of_driver); 401 402 if (!ret) 402 403 any_ret = 0; 403 404 #endif ··· 417 418 { 418 419 platform_driver_unregister(&isp1760_plat_driver); 419 420 #ifdef CONFIG_PPC_OF 420 - of_unregister_platform_driver(&isp1760_of_driver); 421 + platform_driver_unregister(&isp1760_of_driver); 421 422 #endif 422 423 #ifdef CONFIG_PCI 423 424 pci_unregister_driver(&isp1761_pci_driver);
+3 -3
drivers/usb/host/ohci-hcd.c
··· 1180 1180 #endif 1181 1181 1182 1182 #ifdef OF_PLATFORM_DRIVER 1183 - retval = of_register_platform_driver(&OF_PLATFORM_DRIVER); 1183 + retval = platform_driver_register(&OF_PLATFORM_DRIVER); 1184 1184 if (retval < 0) 1185 1185 goto error_of_platform; 1186 1186 #endif ··· 1239 1239 error_sa1111: 1240 1240 #endif 1241 1241 #ifdef OF_PLATFORM_DRIVER 1242 - of_unregister_platform_driver(&OF_PLATFORM_DRIVER); 1242 + platform_driver_unregister(&OF_PLATFORM_DRIVER); 1243 1243 error_of_platform: 1244 1244 #endif 1245 1245 #ifdef PLATFORM_DRIVER ··· 1287 1287 sa1111_driver_unregister(&SA1111_DRIVER); 1288 1288 #endif 1289 1289 #ifdef OF_PLATFORM_DRIVER 1290 - of_unregister_platform_driver(&OF_PLATFORM_DRIVER); 1290 + platform_driver_unregister(&OF_PLATFORM_DRIVER); 1291 1291 #endif 1292 1292 #ifdef PLATFORM_DRIVER 1293 1293 platform_driver_unregister(&PLATFORM_DRIVER);
+3 -6
drivers/usb/host/ohci-ppc-of.c
··· 80 80 }; 81 81 82 82 83 - static int __devinit 84 - ohci_hcd_ppc_of_probe(struct platform_device *op, const struct of_device_id *match) 83 + static int __devinit ohci_hcd_ppc_of_probe(struct platform_device *op) 85 84 { 86 85 struct device_node *dn = op->dev.of_node; 87 86 struct usb_hcd *hcd; ··· 200 201 return 0; 201 202 } 202 203 203 - static int ohci_hcd_ppc_of_shutdown(struct platform_device *op) 204 + static void ohci_hcd_ppc_of_shutdown(struct platform_device *op) 204 205 { 205 206 struct usb_hcd *hcd = dev_get_drvdata(&op->dev); 206 207 207 208 if (hcd->driver->shutdown) 208 209 hcd->driver->shutdown(hcd); 209 - 210 - return 0; 211 210 } 212 211 213 212 ··· 240 243 #endif 241 244 242 245 243 - static struct of_platform_driver ohci_hcd_ppc_of_driver = { 246 + static struct platform_driver ohci_hcd_ppc_of_driver = { 244 247 .probe = ohci_hcd_ppc_of_probe, 245 248 .remove = ohci_hcd_ppc_of_remove, 246 249 .shutdown = ohci_hcd_ppc_of_shutdown,