Commit d35fb6417655ebf6de93e2135dc386c3c470f545
1 parent
28541d0f18
Exists in
master
and in
7 other branches
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>
Showing 8 changed files with 33 additions and 41 deletions Side-by-side Diff
drivers/usb/gadget/fsl_qe_udc.c
... | ... | @@ -2523,8 +2523,7 @@ |
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; |
... | ... | @@ -2532,6 +2531,9 @@ |
2532 | 2531 | unsigned int i; |
2533 | 2532 | const void *prop; |
2534 | 2533 | |
2534 | + if (!ofdev->dev.of_match) | |
2535 | + return -EINVAL; | |
2536 | + | |
2535 | 2537 | prop = of_get_property(np, "mode", NULL); |
2536 | 2538 | if (!prop || strcmp(prop, "peripheral")) |
2537 | 2539 | return -ENODEV; |
... | ... | @@ -2543,7 +2545,7 @@ |
2543 | 2545 | return -ENOMEM; |
2544 | 2546 | } |
2545 | 2547 | |
2546 | - udc_controller->soc_type = (unsigned long)match->data; | |
2548 | + udc_controller->soc_type = (unsigned long)ofdev->dev.of_match->data; | |
2547 | 2549 | udc_controller->usb_regs = of_iomap(np, 0); |
2548 | 2550 | if (!udc_controller->usb_regs) { |
2549 | 2551 | ret = -ENOMEM; |
... | ... | @@ -2768,7 +2770,7 @@ |
2768 | 2770 | |
2769 | 2771 | MODULE_DEVICE_TABLE(of, qe_udc_match); |
2770 | 2772 | |
2771 | -static struct of_platform_driver udc_driver = { | |
2773 | +static struct platform_driver udc_driver = { | |
2772 | 2774 | .driver = { |
2773 | 2775 | .name = (char *)driver_name, |
2774 | 2776 | .owner = THIS_MODULE, |
2775 | 2777 | |
... | ... | @@ -2786,12 +2788,12 @@ |
2786 | 2788 | { |
2787 | 2789 | printk(KERN_INFO "%s: %s, %s\n", driver_name, driver_desc, |
2788 | 2790 | DRIVER_VERSION); |
2789 | - return of_register_platform_driver(&udc_driver); | |
2791 | + return platform_driver_register(&udc_driver); | |
2790 | 2792 | } |
2791 | 2793 | |
2792 | 2794 | static void __exit qe_udc_exit(void) |
2793 | 2795 | { |
2794 | - of_unregister_platform_driver(&udc_driver); | |
2796 | + platform_driver_unregister(&udc_driver); | |
2795 | 2797 | } |
2796 | 2798 | |
2797 | 2799 | module_init(qe_udc_init); |
drivers/usb/host/ehci-hcd.c
... | ... | @@ -1306,24 +1306,24 @@ |
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 |
1330 | 1330 | |
... | ... | @@ -1351,10 +1351,10 @@ |
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); |
drivers/usb/host/ehci-ppc-of.c
... | ... | @@ -105,8 +105,7 @@ |
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; |
113 | 112 | |
... | ... | @@ -255,14 +254,12 @@ |
255 | 254 | } |
256 | 255 | |
257 | 256 | |
258 | -static int ehci_hcd_ppc_of_shutdown(struct platform_device *op) | |
257 | +static void ehci_hcd_ppc_of_shutdown(struct platform_device *op) | |
259 | 258 | { |
260 | 259 | struct usb_hcd *hcd = dev_get_drvdata(&op->dev); |
261 | 260 | |
262 | 261 | if (hcd->driver->shutdown) |
263 | 262 | hcd->driver->shutdown(hcd); |
264 | - | |
265 | - return 0; | |
266 | 263 | } |
267 | 264 | |
268 | 265 | |
... | ... | @@ -275,7 +272,7 @@ |
275 | 272 | MODULE_DEVICE_TABLE(of, ehci_hcd_ppc_of_match); |
276 | 273 | |
277 | 274 | |
278 | -static struct of_platform_driver ehci_hcd_ppc_of_driver = { | |
275 | +static struct platform_driver ehci_hcd_ppc_of_driver = { | |
279 | 276 | .probe = ehci_hcd_ppc_of_probe, |
280 | 277 | .remove = ehci_hcd_ppc_of_remove, |
281 | 278 | .shutdown = ehci_hcd_ppc_of_shutdown, |
drivers/usb/host/ehci-xilinx-of.c
... | ... | @@ -142,15 +142,13 @@ |
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; |
... | ... | @@ -288,7 +286,7 @@ |
288 | 286 | }; |
289 | 287 | MODULE_DEVICE_TABLE(of, ehci_hcd_xilinx_of_match); |
290 | 288 | |
291 | -static struct of_platform_driver ehci_hcd_xilinx_of_driver = { | |
289 | +static struct platform_driver ehci_hcd_xilinx_of_driver = { | |
292 | 290 | .probe = ehci_hcd_xilinx_of_probe, |
293 | 291 | .remove = ehci_hcd_xilinx_of_remove, |
294 | 292 | .shutdown = ehci_hcd_xilinx_of_shutdown, |
drivers/usb/host/fhci-hcd.c
... | ... | @@ -561,8 +561,7 @@ |
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; |
... | ... | @@ -812,7 +811,7 @@ |
812 | 811 | }; |
813 | 812 | MODULE_DEVICE_TABLE(of, of_fhci_match); |
814 | 813 | |
815 | -static struct of_platform_driver of_fhci_driver = { | |
814 | +static struct platform_driver of_fhci_driver = { | |
816 | 815 | .driver = { |
817 | 816 | .name = "fsl,usb-fhci", |
818 | 817 | .owner = THIS_MODULE, |
819 | 818 | |
... | ... | @@ -824,13 +823,13 @@ |
824 | 823 | |
825 | 824 | static int __init fhci_module_init(void) |
826 | 825 | { |
827 | - return of_register_platform_driver(&of_fhci_driver); | |
826 | + return platform_driver_register(&of_fhci_driver); | |
828 | 827 | } |
829 | 828 | module_init(fhci_module_init); |
830 | 829 | |
831 | 830 | static void __exit fhci_module_exit(void) |
832 | 831 | { |
833 | - of_unregister_platform_driver(&of_fhci_driver); | |
832 | + platform_driver_unregister(&of_fhci_driver); | |
834 | 833 | } |
835 | 834 | module_exit(fhci_module_exit); |
836 | 835 |
drivers/usb/host/isp1760-if.c
... | ... | @@ -27,8 +27,7 @@ |
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; |
... | ... | @@ -119,7 +118,7 @@ |
119 | 118 | }; |
120 | 119 | MODULE_DEVICE_TABLE(of, of_isp1760_match); |
121 | 120 | |
122 | -static struct of_platform_driver isp1760_of_driver = { | |
121 | +static struct platform_driver isp1760_of_driver = { | |
123 | 122 | .driver = { |
124 | 123 | .name = "nxp-isp1760", |
125 | 124 | .owner = THIS_MODULE, |
... | ... | @@ -398,7 +397,7 @@ |
398 | 397 | if (!ret) |
399 | 398 | any_ret = 0; |
400 | 399 | #ifdef CONFIG_PPC_OF |
401 | - ret = of_register_platform_driver(&isp1760_of_driver); | |
400 | + ret = platform_driver_register(&isp1760_of_driver); | |
402 | 401 | if (!ret) |
403 | 402 | any_ret = 0; |
404 | 403 | #endif |
... | ... | @@ -418,7 +417,7 @@ |
418 | 417 | { |
419 | 418 | platform_driver_unregister(&isp1760_plat_driver); |
420 | 419 | #ifdef CONFIG_PPC_OF |
421 | - of_unregister_platform_driver(&isp1760_of_driver); | |
420 | + platform_driver_unregister(&isp1760_of_driver); | |
422 | 421 | #endif |
423 | 422 | #ifdef CONFIG_PCI |
424 | 423 | pci_unregister_driver(&isp1761_pci_driver); |
drivers/usb/host/ohci-hcd.c
... | ... | @@ -1180,7 +1180,7 @@ |
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,7 +1239,7 @@ |
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,7 +1287,7 @@ |
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); |
drivers/usb/host/ohci-ppc-of.c
... | ... | @@ -80,8 +80,7 @@ |
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; |
88 | 87 | |
... | ... | @@ -201,14 +200,12 @@ |
201 | 200 | return 0; |
202 | 201 | } |
203 | 202 | |
204 | -static int ohci_hcd_ppc_of_shutdown(struct platform_device *op) | |
203 | +static void ohci_hcd_ppc_of_shutdown(struct platform_device *op) | |
205 | 204 | { |
206 | 205 | struct usb_hcd *hcd = dev_get_drvdata(&op->dev); |
207 | 206 | |
208 | 207 | if (hcd->driver->shutdown) |
209 | 208 | hcd->driver->shutdown(hcd); |
210 | - | |
211 | - return 0; | |
212 | 209 | } |
213 | 210 | |
214 | 211 | |
... | ... | @@ -243,7 +240,7 @@ |
243 | 240 | #endif |
244 | 241 | |
245 | 242 | |
246 | -static struct of_platform_driver ohci_hcd_ppc_of_driver = { | |
243 | +static struct platform_driver ohci_hcd_ppc_of_driver = { | |
247 | 244 | .probe = ohci_hcd_ppc_of_probe, |
248 | 245 | .remove = ohci_hcd_ppc_of_remove, |
249 | 246 | .shutdown = ohci_hcd_ppc_of_shutdown, |