Commit 4ebb24f707187196937607c60810d42f7112d7aa

Authored by Grant Likely
1 parent 000061245a

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

Get rid of old users of of_platform_driver in arch/sparc.  Most
of_platform_driver users can be converted to use the platform_bus
directly.

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

Showing 27 changed files with 133 additions and 148 deletions Side-by-side Diff

arch/sparc/include/asm/parport.h
... ... @@ -103,7 +103,7 @@
103 103 return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info);
104 104 }
105 105  
106   -static int __devinit ecpp_probe(struct platform_device *op, const struct of_device_id *match)
  106 +static int __devinit ecpp_probe(struct platform_device *op)
107 107 {
108 108 unsigned long base = op->resource[0].start;
109 109 unsigned long config = op->resource[1].start;
... ... @@ -235,7 +235,7 @@
235 235 {},
236 236 };
237 237  
238   -static struct of_platform_driver ecpp_driver = {
  238 +static struct platform_driver ecpp_driver = {
239 239 .driver = {
240 240 .name = "ecpp",
241 241 .owner = THIS_MODULE,
... ... @@ -247,7 +247,7 @@
247 247  
248 248 static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
249 249 {
250   - return of_register_platform_driver(&ecpp_driver);
  250 + return platform_driver_register(&ecpp_driver);
251 251 }
252 252  
253 253 #endif /* !(_ASM_SPARC64_PARPORT_H */
arch/sparc/kernel/apc.c
... ... @@ -137,8 +137,7 @@
137 137  
138 138 static struct miscdevice apc_miscdev = { APC_MINOR, APC_DEVNAME, &apc_fops };
139 139  
140   -static int __devinit apc_probe(struct platform_device *op,
141   - const struct of_device_id *match)
  140 +static int __devinit apc_probe(struct platform_device *op)
142 141 {
143 142 int err;
144 143  
... ... @@ -174,7 +173,7 @@
174 173 };
175 174 MODULE_DEVICE_TABLE(of, apc_match);
176 175  
177   -static struct of_platform_driver apc_driver = {
  176 +static struct platform_driver apc_driver = {
178 177 .driver = {
179 178 .name = "apc",
180 179 .owner = THIS_MODULE,
... ... @@ -185,7 +184,7 @@
185 184  
186 185 static int __init apc_init(void)
187 186 {
188   - return of_register_platform_driver(&apc_driver);
  187 + return platform_driver_register(&apc_driver);
189 188 }
190 189  
191 190 /* This driver is not critical to the boot process
arch/sparc/kernel/auxio_64.c
... ... @@ -102,8 +102,7 @@
102 102  
103 103 MODULE_DEVICE_TABLE(of, auxio_match);
104 104  
105   -static int __devinit auxio_probe(struct platform_device *dev,
106   - const struct of_device_id *match)
  105 +static int __devinit auxio_probe(struct platform_device *dev)
107 106 {
108 107 struct device_node *dp = dev->dev.of_node;
109 108 unsigned long size;
... ... @@ -132,7 +131,7 @@
132 131 return 0;
133 132 }
134 133  
135   -static struct of_platform_driver auxio_driver = {
  134 +static struct platform_driver auxio_driver = {
136 135 .probe = auxio_probe,
137 136 .driver = {
138 137 .name = "auxio",
... ... @@ -143,7 +142,7 @@
143 142  
144 143 static int __init auxio_init(void)
145 144 {
146   - return of_register_platform_driver(&auxio_driver);
  145 + return platform_driver_register(&auxio_driver);
147 146 }
148 147  
149 148 /* Must be after subsys_initcall() so that busses are probed. Must
arch/sparc/kernel/central.c
... ... @@ -59,8 +59,7 @@
59 59 }
60 60 }
61 61  
62   -static int __devinit clock_board_probe(struct platform_device *op,
63   - const struct of_device_id *match)
  62 +static int __devinit clock_board_probe(struct platform_device *op)
64 63 {
65 64 struct clock_board *p = kzalloc(sizeof(*p), GFP_KERNEL);
66 65 int err = -ENOMEM;
... ... @@ -148,7 +147,7 @@
148 147 {},
149 148 };
150 149  
151   -static struct of_platform_driver clock_board_driver = {
  150 +static struct platform_driver clock_board_driver = {
152 151 .probe = clock_board_probe,
153 152 .driver = {
154 153 .name = "clock_board",
... ... @@ -157,8 +156,7 @@
157 156 },
158 157 };
159 158  
160   -static int __devinit fhc_probe(struct platform_device *op,
161   - const struct of_device_id *match)
  159 +static int __devinit fhc_probe(struct platform_device *op)
162 160 {
163 161 struct fhc *p = kzalloc(sizeof(*p), GFP_KERNEL);
164 162 int err = -ENOMEM;
... ... @@ -254,7 +252,7 @@
254 252 {},
255 253 };
256 254  
257   -static struct of_platform_driver fhc_driver = {
  255 +static struct platform_driver fhc_driver = {
258 256 .probe = fhc_probe,
259 257 .driver = {
260 258 .name = "fhc",
... ... @@ -265,8 +263,8 @@
265 263  
266 264 static int __init sunfire_init(void)
267 265 {
268   - (void) of_register_platform_driver(&fhc_driver);
269   - (void) of_register_platform_driver(&clock_board_driver);
  266 + (void) platform_driver_register(&fhc_driver);
  267 + (void) platform_driver_register(&clock_board_driver);
270 268 return 0;
271 269 }
272 270  
arch/sparc/kernel/chmc.c
... ... @@ -392,8 +392,7 @@
392 392 }
393 393 }
394 394  
395   -static int __devinit jbusmc_probe(struct platform_device *op,
396   - const struct of_device_id *match)
  395 +static int __devinit jbusmc_probe(struct platform_device *op)
397 396 {
398 397 const struct linux_prom64_registers *mem_regs;
399 398 struct device_node *mem_node;
... ... @@ -690,8 +689,7 @@
690 689 chmc_read_mcreg(p, CHMCTRL_DECODE4));
691 690 }
692 691  
693   -static int __devinit chmc_probe(struct platform_device *op,
694   - const struct of_device_id *match)
  692 +static int __devinit chmc_probe(struct platform_device *op)
695 693 {
696 694 struct device_node *dp = op->dev.of_node;
697 695 unsigned long ver;
698 696  
699 697  
... ... @@ -765,13 +763,12 @@
765 763 goto out;
766 764 }
767 765  
768   -static int __devinit us3mc_probe(struct platform_device *op,
769   - const struct of_device_id *match)
  766 +static int __devinit us3mc_probe(struct platform_device *op)
770 767 {
771 768 if (mc_type == MC_TYPE_SAFARI)
772   - return chmc_probe(op, match);
  769 + return chmc_probe(op);
773 770 else if (mc_type == MC_TYPE_JBUS)
774   - return jbusmc_probe(op, match);
  771 + return jbusmc_probe(op);
775 772 return -ENODEV;
776 773 }
777 774  
... ... @@ -810,7 +807,7 @@
810 807 };
811 808 MODULE_DEVICE_TABLE(of, us3mc_match);
812 809  
813   -static struct of_platform_driver us3mc_driver = {
  810 +static struct platform_driver us3mc_driver = {
814 811 .driver = {
815 812 .name = "us3mc",
816 813 .owner = THIS_MODULE,
... ... @@ -848,7 +845,7 @@
848 845 ret = register_dimm_printer(us3mc_dimm_printer);
849 846  
850 847 if (!ret) {
851   - ret = of_register_platform_driver(&us3mc_driver);
  848 + ret = platform_driver_register(&us3mc_driver);
852 849 if (ret)
853 850 unregister_dimm_printer(us3mc_dimm_printer);
854 851 }
... ... @@ -859,7 +856,7 @@
859 856 {
860 857 if (us3mc_platform()) {
861 858 unregister_dimm_printer(us3mc_dimm_printer);
862   - of_unregister_platform_driver(&us3mc_driver);
  859 + platform_driver_unregister(&us3mc_driver);
863 860 }
864 861 }
865 862  
arch/sparc/kernel/pci_fire.c
... ... @@ -455,8 +455,7 @@
455 455 return 0;
456 456 }
457 457  
458   -static int __devinit fire_probe(struct platform_device *op,
459   - const struct of_device_id *match)
  458 +static int __devinit fire_probe(struct platform_device *op)
460 459 {
461 460 struct device_node *dp = op->dev.of_node;
462 461 struct pci_pbm_info *pbm;
... ... @@ -507,7 +506,7 @@
507 506 {},
508 507 };
509 508  
510   -static struct of_platform_driver fire_driver = {
  509 +static struct platform_driver fire_driver = {
511 510 .driver = {
512 511 .name = DRIVER_NAME,
513 512 .owner = THIS_MODULE,
... ... @@ -518,7 +517,7 @@
518 517  
519 518 static int __init fire_init(void)
520 519 {
521   - return of_register_platform_driver(&fire_driver);
  520 + return platform_driver_register(&fire_driver);
522 521 }
523 522  
524 523 subsys_initcall(fire_init);
arch/sparc/kernel/pci_psycho.c
... ... @@ -503,8 +503,7 @@
503 503  
504 504 #define PSYCHO_CONFIGSPACE 0x001000000UL
505 505  
506   -static int __devinit psycho_probe(struct platform_device *op,
507   - const struct of_device_id *match)
  506 +static int __devinit psycho_probe(struct platform_device *op)
508 507 {
509 508 const struct linux_prom64_registers *pr_regs;
510 509 struct device_node *dp = op->dev.of_node;
... ... @@ -601,7 +600,7 @@
601 600 {},
602 601 };
603 602  
604   -static struct of_platform_driver psycho_driver = {
  603 +static struct platform_driver psycho_driver = {
605 604 .driver = {
606 605 .name = DRIVER_NAME,
607 606 .owner = THIS_MODULE,
... ... @@ -612,7 +611,7 @@
612 611  
613 612 static int __init psycho_init(void)
614 613 {
615   - return of_register_platform_driver(&psycho_driver);
  614 + return platform_driver_register(&psycho_driver);
616 615 }
617 616  
618 617 subsys_initcall(psycho_init);
arch/sparc/kernel/pci_sabre.c
... ... @@ -452,8 +452,7 @@
452 452 sabre_scan_bus(pbm, &op->dev);
453 453 }
454 454  
455   -static int __devinit sabre_probe(struct platform_device *op,
456   - const struct of_device_id *match)
  455 +static int __devinit sabre_probe(struct platform_device *op)
457 456 {
458 457 const struct linux_prom64_registers *pr_regs;
459 458 struct device_node *dp = op->dev.of_node;
... ... @@ -464,7 +463,7 @@
464 463 const u32 *vdma;
465 464 u64 clear_irq;
466 465  
467   - hummingbird_p = (match->data != NULL);
  466 + hummingbird_p = op->dev.of_match && (op->dev.of_match->data != NULL);
468 467 if (!hummingbird_p) {
469 468 struct device_node *cpu_dp;
470 469  
... ... @@ -595,7 +594,7 @@
595 594 {},
596 595 };
597 596  
598   -static struct of_platform_driver sabre_driver = {
  597 +static struct platform_driver sabre_driver = {
599 598 .driver = {
600 599 .name = DRIVER_NAME,
601 600 .owner = THIS_MODULE,
... ... @@ -606,7 +605,7 @@
606 605  
607 606 static int __init sabre_init(void)
608 607 {
609   - return of_register_platform_driver(&sabre_driver);
  608 + return platform_driver_register(&sabre_driver);
610 609 }
611 610  
612 611 subsys_initcall(sabre_init);
arch/sparc/kernel/pci_schizo.c
... ... @@ -1460,10 +1460,11 @@
1460 1460 return err;
1461 1461 }
1462 1462  
1463   -static int __devinit schizo_probe(struct platform_device *op,
1464   - const struct of_device_id *match)
  1463 +static int __devinit schizo_probe(struct platform_device *op)
1465 1464 {
1466   - return __schizo_init(op, (unsigned long) match->data);
  1465 + if (!op->dev.of_match)
  1466 + return -EINVAL;
  1467 + return __schizo_init(op, (unsigned long) op->dev.of_match->data);
1467 1468 }
1468 1469  
1469 1470 /* The ordering of this table is very important. Some Tomatillo
... ... @@ -1490,7 +1491,7 @@
1490 1491 {},
1491 1492 };
1492 1493  
1493   -static struct of_platform_driver schizo_driver = {
  1494 +static struct platform_driver schizo_driver = {
1494 1495 .driver = {
1495 1496 .name = DRIVER_NAME,
1496 1497 .owner = THIS_MODULE,
... ... @@ -1501,7 +1502,7 @@
1501 1502  
1502 1503 static int __init schizo_init(void)
1503 1504 {
1504   - return of_register_platform_driver(&schizo_driver);
  1505 + return platform_driver_register(&schizo_driver);
1505 1506 }
1506 1507  
1507 1508 subsys_initcall(schizo_init);
arch/sparc/kernel/pci_sun4v.c
... ... @@ -918,8 +918,7 @@
918 918 return 0;
919 919 }
920 920  
921   -static int __devinit pci_sun4v_probe(struct platform_device *op,
922   - const struct of_device_id *match)
  921 +static int __devinit pci_sun4v_probe(struct platform_device *op)
923 922 {
924 923 const struct linux_prom64_registers *regs;
925 924 static int hvapi_negotiated = 0;
... ... @@ -1008,7 +1007,7 @@
1008 1007 {},
1009 1008 };
1010 1009  
1011   -static struct of_platform_driver pci_sun4v_driver = {
  1010 +static struct platform_driver pci_sun4v_driver = {
1012 1011 .driver = {
1013 1012 .name = DRIVER_NAME,
1014 1013 .owner = THIS_MODULE,
... ... @@ -1019,7 +1018,7 @@
1019 1018  
1020 1019 static int __init pci_sun4v_init(void)
1021 1020 {
1022   - return of_register_platform_driver(&pci_sun4v_driver);
  1021 + return platform_driver_register(&pci_sun4v_driver);
1023 1022 }
1024 1023  
1025 1024 subsys_initcall(pci_sun4v_init);
arch/sparc/kernel/pmc.c
... ... @@ -51,8 +51,7 @@
51 51 #endif
52 52 }
53 53  
54   -static int __devinit pmc_probe(struct platform_device *op,
55   - const struct of_device_id *match)
  54 +static int __devinit pmc_probe(struct platform_device *op)
56 55 {
57 56 regs = of_ioremap(&op->resource[0], 0,
58 57 resource_size(&op->resource[0]), PMC_OBPNAME);
... ... @@ -78,7 +77,7 @@
78 77 };
79 78 MODULE_DEVICE_TABLE(of, pmc_match);
80 79  
81   -static struct of_platform_driver pmc_driver = {
  80 +static struct platform_driver pmc_driver = {
82 81 .driver = {
83 82 .name = "pmc",
84 83 .owner = THIS_MODULE,
... ... @@ -89,7 +88,7 @@
89 88  
90 89 static int __init pmc_init(void)
91 90 {
92   - return of_register_platform_driver(&pmc_driver);
  91 + return platform_driver_register(&pmc_driver);
93 92 }
94 93  
95 94 /* This driver is not critical to the boot process
arch/sparc/kernel/power.c
... ... @@ -33,7 +33,7 @@
33 33 return 1;
34 34 }
35 35  
36   -static int __devinit power_probe(struct platform_device *op, const struct of_device_id *match)
  36 +static int __devinit power_probe(struct platform_device *op)
37 37 {
38 38 struct resource *res = &op->resource[0];
39 39 unsigned int irq = op->archdata.irqs[0];
... ... @@ -59,7 +59,7 @@
59 59 {},
60 60 };
61 61  
62   -static struct of_platform_driver power_driver = {
  62 +static struct platform_driver power_driver = {
63 63 .probe = power_probe,
64 64 .driver = {
65 65 .name = "power",
... ... @@ -70,7 +70,7 @@
70 70  
71 71 static int __init power_init(void)
72 72 {
73   - return of_register_platform_driver(&power_driver);
  73 + return platform_driver_register(&power_driver);
74 74 }
75 75  
76 76 device_initcall(power_init);
arch/sparc/kernel/time_32.c
... ... @@ -142,7 +142,7 @@
142 142 },
143 143 };
144 144  
145   -static int __devinit clock_probe(struct platform_device *op, const struct of_device_id *match)
  145 +static int __devinit clock_probe(struct platform_device *op)
146 146 {
147 147 struct device_node *dp = op->dev.of_node;
148 148 const char *model = of_get_property(dp, "model", NULL);
... ... @@ -176,7 +176,7 @@
176 176 {},
177 177 };
178 178  
179   -static struct of_platform_driver clock_driver = {
  179 +static struct platform_driver clock_driver = {
180 180 .probe = clock_probe,
181 181 .driver = {
182 182 .name = "rtc",
... ... @@ -189,7 +189,7 @@
189 189 /* Probe for the mostek real time clock chip. */
190 190 static int __init clock_init(void)
191 191 {
192   - return of_register_platform_driver(&clock_driver);
  192 + return platform_driver_register(&clock_driver);
193 193 }
194 194 /* Must be after subsys_initcall() so that busses are probed. Must
195 195 * be before device_initcall() because things like the RTC driver
arch/sparc/kernel/time_64.c
... ... @@ -419,7 +419,7 @@
419 419 .num_resources = 1,
420 420 };
421 421  
422   -static int __devinit rtc_probe(struct platform_device *op, const struct of_device_id *match)
  422 +static int __devinit rtc_probe(struct platform_device *op)
423 423 {
424 424 struct resource *r;
425 425  
... ... @@ -462,7 +462,7 @@
462 462 {},
463 463 };
464 464  
465   -static struct of_platform_driver rtc_driver = {
  465 +static struct platform_driver rtc_driver = {
466 466 .probe = rtc_probe,
467 467 .driver = {
468 468 .name = "rtc",
... ... @@ -477,7 +477,7 @@
477 477 .num_resources = 1,
478 478 };
479 479  
480   -static int __devinit bq4802_probe(struct platform_device *op, const struct of_device_id *match)
  480 +static int __devinit bq4802_probe(struct platform_device *op)
481 481 {
482 482  
483 483 printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n",
... ... @@ -495,7 +495,7 @@
495 495 {},
496 496 };
497 497  
498   -static struct of_platform_driver bq4802_driver = {
  498 +static struct platform_driver bq4802_driver = {
499 499 .probe = bq4802_probe,
500 500 .driver = {
501 501 .name = "bq4802",
... ... @@ -534,7 +534,7 @@
534 534 },
535 535 };
536 536  
537   -static int __devinit mostek_probe(struct platform_device *op, const struct of_device_id *match)
  537 +static int __devinit mostek_probe(struct platform_device *op)
538 538 {
539 539 struct device_node *dp = op->dev.of_node;
540 540  
... ... @@ -559,7 +559,7 @@
559 559 {},
560 560 };
561 561  
562   -static struct of_platform_driver mostek_driver = {
  562 +static struct platform_driver mostek_driver = {
563 563 .probe = mostek_probe,
564 564 .driver = {
565 565 .name = "mostek",
... ... @@ -586,9 +586,9 @@
586 586 if (tlb_type == hypervisor)
587 587 return platform_device_register(&rtc_sun4v_device);
588 588  
589   - (void) of_register_platform_driver(&rtc_driver);
590   - (void) of_register_platform_driver(&mostek_driver);
591   - (void) of_register_platform_driver(&bq4802_driver);
  589 + (void) platform_driver_register(&rtc_driver);
  590 + (void) platform_driver_register(&mostek_driver);
  591 + (void) platform_driver_register(&bq4802_driver);
592 592  
593 593 return 0;
594 594 }
drivers/char/hw_random/n2-drv.c
... ... @@ -619,15 +619,17 @@
619 619 pr_info("%s", version);
620 620 }
621 621  
622   -static int __devinit n2rng_probe(struct platform_device *op,
623   - const struct of_device_id *match)
  622 +static int __devinit n2rng_probe(struct platform_device *op)
624 623 {
625   - int victoria_falls = (match->data != NULL);
  624 + int victoria_falls;
626 625 int err = -ENOMEM;
627 626 struct n2rng *np;
628 627  
629   - n2rng_driver_version();
  628 + if (!op->dev.of_match)
  629 + return -EINVAL;
  630 + victoria_falls = (op->dev.of_match->data != NULL);
630 631  
  632 + n2rng_driver_version();
631 633 np = kzalloc(sizeof(*np), GFP_KERNEL);
632 634 if (!np)
633 635 goto out;
... ... @@ -750,7 +752,7 @@
750 752 };
751 753 MODULE_DEVICE_TABLE(of, n2rng_match);
752 754  
753   -static struct of_platform_driver n2rng_driver = {
  755 +static struct platform_driver n2rng_driver = {
754 756 .driver = {
755 757 .name = "n2rng",
756 758 .owner = THIS_MODULE,
757 759  
... ... @@ -762,12 +764,12 @@
762 764  
763 765 static int __init n2rng_init(void)
764 766 {
765   - return of_register_platform_driver(&n2rng_driver);
  767 + return platform_driver_register(&n2rng_driver);
766 768 }
767 769  
768 770 static void __exit n2rng_exit(void)
769 771 {
770   - of_unregister_platform_driver(&n2rng_driver);
  772 + platform_driver_unregister(&n2rng_driver);
771 773 }
772 774  
773 775 module_init(n2rng_init);
drivers/crypto/n2_core.c
... ... @@ -2004,8 +2004,7 @@
2004 2004 pr_info("%s", version);
2005 2005 }
2006 2006  
2007   -static int __devinit n2_crypto_probe(struct platform_device *dev,
2008   - const struct of_device_id *match)
  2007 +static int __devinit n2_crypto_probe(struct platform_device *dev)
2009 2008 {
2010 2009 struct mdesc_handle *mdesc;
2011 2010 const char *full_name;
... ... @@ -2116,8 +2115,7 @@
2116 2115 kfree(mp);
2117 2116 }
2118 2117  
2119   -static int __devinit n2_mau_probe(struct platform_device *dev,
2120   - const struct of_device_id *match)
  2118 +static int __devinit n2_mau_probe(struct platform_device *dev)
2121 2119 {
2122 2120 struct mdesc_handle *mdesc;
2123 2121 const char *full_name;
... ... @@ -2211,7 +2209,7 @@
2211 2209  
2212 2210 MODULE_DEVICE_TABLE(of, n2_crypto_match);
2213 2211  
2214   -static struct of_platform_driver n2_crypto_driver = {
  2212 +static struct platform_driver n2_crypto_driver = {
2215 2213 .driver = {
2216 2214 .name = "n2cp",
2217 2215 .owner = THIS_MODULE,
... ... @@ -2235,7 +2233,7 @@
2235 2233  
2236 2234 MODULE_DEVICE_TABLE(of, n2_mau_match);
2237 2235  
2238   -static struct of_platform_driver n2_mau_driver = {
  2236 +static struct platform_driver n2_mau_driver = {
2239 2237 .driver = {
2240 2238 .name = "ncp",
2241 2239 .owner = THIS_MODULE,
2242 2240  
2243 2241  
2244 2242  
... ... @@ -2247,20 +2245,20 @@
2247 2245  
2248 2246 static int __init n2_init(void)
2249 2247 {
2250   - int err = of_register_platform_driver(&n2_crypto_driver);
  2248 + int err = platform_driver_register(&n2_crypto_driver);
2251 2249  
2252 2250 if (!err) {
2253   - err = of_register_platform_driver(&n2_mau_driver);
  2251 + err = platform_driver_register(&n2_mau_driver);
2254 2252 if (err)
2255   - of_unregister_platform_driver(&n2_crypto_driver);
  2253 + platform_driver_unregister(&n2_crypto_driver);
2256 2254 }
2257 2255 return err;
2258 2256 }
2259 2257  
2260 2258 static void __exit n2_exit(void)
2261 2259 {
2262   - of_unregister_platform_driver(&n2_mau_driver);
2263   - of_unregister_platform_driver(&n2_crypto_driver);
  2260 + platform_driver_unregister(&n2_mau_driver);
  2261 + platform_driver_unregister(&n2_crypto_driver);
2264 2262 }
2265 2263  
2266 2264 module_init(n2_init);
drivers/hwmon/ultra45_env.c
... ... @@ -234,8 +234,7 @@
234 234 .attrs = env_attributes,
235 235 };
236 236  
237   -static int __devinit env_probe(struct platform_device *op,
238   - const struct of_device_id *match)
  237 +static int __devinit env_probe(struct platform_device *op)
239 238 {
240 239 struct env *p = kzalloc(sizeof(*p), GFP_KERNEL);
241 240 int err = -ENOMEM;
... ... @@ -299,7 +298,7 @@
299 298 };
300 299 MODULE_DEVICE_TABLE(of, env_match);
301 300  
302   -static struct of_platform_driver env_driver = {
  301 +static struct platform_driver env_driver = {
303 302 .driver = {
304 303 .name = "ultra45_env",
305 304 .owner = THIS_MODULE,
306 305  
... ... @@ -311,12 +310,12 @@
311 310  
312 311 static int __init env_init(void)
313 312 {
314   - return of_register_platform_driver(&env_driver);
  313 + return platform_driver_register(&env_driver);
315 314 }
316 315  
317 316 static void __exit env_exit(void)
318 317 {
319   - of_unregister_platform_driver(&env_driver);
  318 + platform_driver_unregister(&env_driver);
320 319 }
321 320  
322 321 module_init(env_init);
drivers/input/misc/sparcspkr.c
... ... @@ -173,18 +173,16 @@
173 173 return 0;
174 174 }
175 175  
176   -static int sparcspkr_shutdown(struct platform_device *dev)
  176 +static void sparcspkr_shutdown(struct platform_device *dev)
177 177 {
178 178 struct sparcspkr_state *state = dev_get_drvdata(&dev->dev);
179 179 struct input_dev *input_dev = state->input_dev;
180 180  
181 181 /* turn off the speaker */
182 182 state->event(input_dev, EV_SND, SND_BELL, 0);
183   -
184   - return 0;
185 183 }
186 184  
187   -static int __devinit bbc_beep_probe(struct platform_device *op, const struct of_device_id *match)
  185 +static int __devinit bbc_beep_probe(struct platform_device *op)
188 186 {
189 187 struct sparcspkr_state *state;
190 188 struct bbc_beep_info *info;
... ... @@ -258,7 +256,7 @@
258 256 {},
259 257 };
260 258  
261   -static struct of_platform_driver bbc_beep_driver = {
  259 +static struct platform_driver bbc_beep_driver = {
262 260 .driver = {
263 261 .name = "bbcbeep",
264 262 .owner = THIS_MODULE,
... ... @@ -269,7 +267,7 @@
269 267 .shutdown = sparcspkr_shutdown,
270 268 };
271 269  
272   -static int __devinit grover_beep_probe(struct platform_device *op, const struct of_device_id *match)
  270 +static int __devinit grover_beep_probe(struct platform_device *op)
273 271 {
274 272 struct sparcspkr_state *state;
275 273 struct grover_beep_info *info;
... ... @@ -340,7 +338,7 @@
340 338 {},
341 339 };
342 340  
343   -static struct of_platform_driver grover_beep_driver = {
  341 +static struct platform_driver grover_beep_driver = {
344 342 .driver = {
345 343 .name = "groverbeep",
346 344 .owner = THIS_MODULE,
347 345  
348 346  
... ... @@ -353,12 +351,12 @@
353 351  
354 352 static int __init sparcspkr_init(void)
355 353 {
356   - int err = of_register_platform_driver(&bbc_beep_driver);
  354 + int err = platform_driver_register(&bbc_beep_driver);
357 355  
358 356 if (!err) {
359   - err = of_register_platform_driver(&grover_beep_driver);
  357 + err = platform_driver_register(&grover_beep_driver);
360 358 if (err)
361   - of_unregister_platform_driver(&bbc_beep_driver);
  359 + platform_driver_unregister(&bbc_beep_driver);
362 360 }
363 361  
364 362 return err;
... ... @@ -366,8 +364,8 @@
366 364  
367 365 static void __exit sparcspkr_exit(void)
368 366 {
369   - of_unregister_platform_driver(&bbc_beep_driver);
370   - of_unregister_platform_driver(&grover_beep_driver);
  367 + platform_driver_unregister(&bbc_beep_driver);
  368 + platform_driver_unregister(&grover_beep_driver);
371 369 }
372 370  
373 371 module_init(sparcspkr_init);
drivers/input/serio/i8042-sparcio.h
... ... @@ -49,7 +49,7 @@
49 49 #define OBP_PS2MS_NAME1 "kdmouse"
50 50 #define OBP_PS2MS_NAME2 "mouse"
51 51  
52   -static int __devinit sparc_i8042_probe(struct platform_device *op, const struct of_device_id *match)
  52 +static int __devinit sparc_i8042_probe(struct platform_device *op)
53 53 {
54 54 struct device_node *dp = op->dev.of_node;
55 55  
... ... @@ -95,7 +95,7 @@
95 95 };
96 96 MODULE_DEVICE_TABLE(of, sparc_i8042_match);
97 97  
98   -static struct of_platform_driver sparc_i8042_driver = {
  98 +static struct platform_driver sparc_i8042_driver = {
99 99 .driver = {
100 100 .name = "i8042",
101 101 .owner = THIS_MODULE,
... ... @@ -116,7 +116,7 @@
116 116 if (!kbd_iobase)
117 117 return -ENODEV;
118 118 } else {
119   - int err = of_register_platform_driver(&sparc_i8042_driver);
  119 + int err = platform_driver_register(&sparc_i8042_driver);
120 120 if (err)
121 121 return err;
122 122  
... ... @@ -140,7 +140,7 @@
140 140 struct device_node *root = of_find_node_by_path("/");
141 141  
142 142 if (strcmp(root->name, "SUNW,JavaStation-1"))
143   - of_unregister_platform_driver(&sparc_i8042_driver);
  143 + platform_driver_unregister(&sparc_i8042_driver);
144 144 }
145 145  
146 146 #else /* !CONFIG_PCI */
drivers/parport/parport_sunbpp.c
... ... @@ -286,7 +286,7 @@
286 286 .owner = THIS_MODULE,
287 287 };
288 288  
289   -static int __devinit bpp_probe(struct platform_device *op, const struct of_device_id *match)
  289 +static int __devinit bpp_probe(struct platform_device *op)
290 290 {
291 291 struct parport_operations *ops;
292 292 struct bpp_regs __iomem *regs;
... ... @@ -381,7 +381,7 @@
381 381  
382 382 MODULE_DEVICE_TABLE(of, bpp_match);
383 383  
384   -static struct of_platform_driver bpp_sbus_driver = {
  384 +static struct platform_driver bpp_sbus_driver = {
385 385 .driver = {
386 386 .name = "bpp",
387 387 .owner = THIS_MODULE,
388 388  
... ... @@ -393,12 +393,12 @@
393 393  
394 394 static int __init parport_sunbpp_init(void)
395 395 {
396   - return of_register_platform_driver(&bpp_sbus_driver);
  396 + return platform_driver_register(&bpp_sbus_driver);
397 397 }
398 398  
399 399 static void __exit parport_sunbpp_exit(void)
400 400 {
401   - of_unregister_platform_driver(&bpp_sbus_driver);
  401 + platform_driver_unregister(&bpp_sbus_driver);
402 402 }
403 403  
404 404 MODULE_AUTHOR("Derrick J Brashear");
drivers/sbus/char/bbc_i2c.c
... ... @@ -361,8 +361,7 @@
361 361 extern int bbc_envctrl_init(struct bbc_i2c_bus *bp);
362 362 extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp);
363 363  
364   -static int __devinit bbc_i2c_probe(struct platform_device *op,
365   - const struct of_device_id *match)
  364 +static int __devinit bbc_i2c_probe(struct platform_device *op)
366 365 {
367 366 struct bbc_i2c_bus *bp;
368 367 int err, index = 0;
... ... @@ -413,7 +412,7 @@
413 412 };
414 413 MODULE_DEVICE_TABLE(of, bbc_i2c_match);
415 414  
416   -static struct of_platform_driver bbc_i2c_driver = {
  415 +static struct platform_driver bbc_i2c_driver = {
417 416 .driver = {
418 417 .name = "bbc_i2c",
419 418 .owner = THIS_MODULE,
420 419  
... ... @@ -425,12 +424,12 @@
425 424  
426 425 static int __init bbc_i2c_init(void)
427 426 {
428   - return of_register_platform_driver(&bbc_i2c_driver);
  427 + return platform_driver_register(&bbc_i2c_driver);
429 428 }
430 429  
431 430 static void __exit bbc_i2c_exit(void)
432 431 {
433   - of_unregister_platform_driver(&bbc_i2c_driver);
  432 + platform_driver_unregister(&bbc_i2c_driver);
434 433 }
435 434  
436 435 module_init(bbc_i2c_init);
drivers/sbus/char/display7seg.c
... ... @@ -171,8 +171,7 @@
171 171 .fops = &d7s_fops
172 172 };
173 173  
174   -static int __devinit d7s_probe(struct platform_device *op,
175   - const struct of_device_id *match)
  174 +static int __devinit d7s_probe(struct platform_device *op)
176 175 {
177 176 struct device_node *opts;
178 177 int err = -EINVAL;
... ... @@ -266,7 +265,7 @@
266 265 };
267 266 MODULE_DEVICE_TABLE(of, d7s_match);
268 267  
269   -static struct of_platform_driver d7s_driver = {
  268 +static struct platform_driver d7s_driver = {
270 269 .driver = {
271 270 .name = DRIVER_NAME,
272 271 .owner = THIS_MODULE,
273 272  
... ... @@ -278,12 +277,12 @@
278 277  
279 278 static int __init d7s_init(void)
280 279 {
281   - return of_register_platform_driver(&d7s_driver);
  280 + return platform_driver_register(&d7s_driver);
282 281 }
283 282  
284 283 static void __exit d7s_exit(void)
285 284 {
286   - of_unregister_platform_driver(&d7s_driver);
  285 + platform_driver_unregister(&d7s_driver);
287 286 }
288 287  
289 288 module_init(d7s_init);
drivers/sbus/char/envctrl.c
... ... @@ -1028,8 +1028,7 @@
1028 1028 return 0;
1029 1029 }
1030 1030  
1031   -static int __devinit envctrl_probe(struct platform_device *op,
1032   - const struct of_device_id *match)
  1031 +static int __devinit envctrl_probe(struct platform_device *op)
1033 1032 {
1034 1033 struct device_node *dp;
1035 1034 int index, err;
... ... @@ -1129,7 +1128,7 @@
1129 1128 };
1130 1129 MODULE_DEVICE_TABLE(of, envctrl_match);
1131 1130  
1132   -static struct of_platform_driver envctrl_driver = {
  1131 +static struct platform_driver envctrl_driver = {
1133 1132 .driver = {
1134 1133 .name = DRIVER_NAME,
1135 1134 .owner = THIS_MODULE,
1136 1135  
... ... @@ -1141,12 +1140,12 @@
1141 1140  
1142 1141 static int __init envctrl_init(void)
1143 1142 {
1144   - return of_register_platform_driver(&envctrl_driver);
  1143 + return platform_driver_register(&envctrl_driver);
1145 1144 }
1146 1145  
1147 1146 static void __exit envctrl_exit(void)
1148 1147 {
1149   - of_unregister_platform_driver(&envctrl_driver);
  1148 + platform_driver_unregister(&envctrl_driver);
1150 1149 }
1151 1150  
1152 1151 module_init(envctrl_init);
drivers/sbus/char/flash.c
... ... @@ -160,8 +160,7 @@
160 160  
161 161 static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops };
162 162  
163   -static int __devinit flash_probe(struct platform_device *op,
164   - const struct of_device_id *match)
  163 +static int __devinit flash_probe(struct platform_device *op)
165 164 {
166 165 struct device_node *dp = op->dev.of_node;
167 166 struct device_node *parent;
... ... @@ -207,7 +206,7 @@
207 206 };
208 207 MODULE_DEVICE_TABLE(of, flash_match);
209 208  
210   -static struct of_platform_driver flash_driver = {
  209 +static struct platform_driver flash_driver = {
211 210 .driver = {
212 211 .name = "flash",
213 212 .owner = THIS_MODULE,
214 213  
... ... @@ -219,12 +218,12 @@
219 218  
220 219 static int __init flash_init(void)
221 220 {
222   - return of_register_platform_driver(&flash_driver);
  221 + return platform_driver_register(&flash_driver);
223 222 }
224 223  
225 224 static void __exit flash_cleanup(void)
226 225 {
227   - of_unregister_platform_driver(&flash_driver);
  226 + platform_driver_unregister(&flash_driver);
228 227 }
229 228  
230 229 module_init(flash_init);
drivers/sbus/char/uctrl.c
... ... @@ -348,8 +348,7 @@
348 348  
349 349 }
350 350  
351   -static int __devinit uctrl_probe(struct platform_device *op,
352   - const struct of_device_id *match)
  351 +static int __devinit uctrl_probe(struct platform_device *op)
353 352 {
354 353 struct uctrl_driver *p;
355 354 int err = -ENOMEM;
... ... @@ -425,7 +424,7 @@
425 424 };
426 425 MODULE_DEVICE_TABLE(of, uctrl_match);
427 426  
428   -static struct of_platform_driver uctrl_driver = {
  427 +static struct platform_driver uctrl_driver = {
429 428 .driver = {
430 429 .name = "uctrl",
431 430 .owner = THIS_MODULE,
432 431  
... ... @@ -438,12 +437,12 @@
438 437  
439 438 static int __init uctrl_init(void)
440 439 {
441   - return of_register_platform_driver(&uctrl_driver);
  440 + return platform_driver_register(&uctrl_driver);
442 441 }
443 442  
444 443 static void __exit uctrl_exit(void)
445 444 {
446   - of_unregister_platform_driver(&uctrl_driver);
  445 + platform_driver_unregister(&uctrl_driver);
447 446 }
448 447  
449 448 module_init(uctrl_init);
drivers/scsi/qlogicpti.c
... ... @@ -1292,15 +1292,19 @@
1292 1292 .use_clustering = ENABLE_CLUSTERING,
1293 1293 };
1294 1294  
1295   -static int __devinit qpti_sbus_probe(struct platform_device *op, const struct of_device_id *match)
  1295 +static int __devinit qpti_sbus_probe(struct platform_device *op)
1296 1296 {
1297   - struct scsi_host_template *tpnt = match->data;
  1297 + struct scsi_host_template *tpnt;
1298 1298 struct device_node *dp = op->dev.of_node;
1299 1299 struct Scsi_Host *host;
1300 1300 struct qlogicpti *qpti;
1301 1301 static int nqptis;
1302 1302 const char *fcode;
1303 1303  
  1304 + if (!op->dev.of_match)
  1305 + return -EINVAL;
  1306 + tpnt = op->dev.of_match->data;
  1307 +
1304 1308 /* Sometimes Antares cards come up not completely
1305 1309 * setup, and we get a report of a zero IRQ.
1306 1310 */
... ... @@ -1457,7 +1461,7 @@
1457 1461 };
1458 1462 MODULE_DEVICE_TABLE(of, qpti_match);
1459 1463  
1460   -static struct of_platform_driver qpti_sbus_driver = {
  1464 +static struct platform_driver qpti_sbus_driver = {
1461 1465 .driver = {
1462 1466 .name = "qpti",
1463 1467 .owner = THIS_MODULE,
1464 1468  
... ... @@ -1469,12 +1473,12 @@
1469 1473  
1470 1474 static int __init qpti_init(void)
1471 1475 {
1472   - return of_register_platform_driver(&qpti_sbus_driver);
  1476 + return platform_driver_register(&qpti_sbus_driver);
1473 1477 }
1474 1478  
1475 1479 static void __exit qpti_exit(void)
1476 1480 {
1477   - of_unregister_platform_driver(&qpti_sbus_driver);
  1481 + platform_driver_unregister(&qpti_sbus_driver);
1478 1482 }
1479 1483  
1480 1484 MODULE_DESCRIPTION("QlogicISP SBUS driver");
drivers/scsi/sun_esp.c
... ... @@ -562,7 +562,7 @@
562 562 return err;
563 563 }
564 564  
565   -static int __devinit esp_sbus_probe(struct platform_device *op, const struct of_device_id *match)
  565 +static int __devinit esp_sbus_probe(struct platform_device *op)
566 566 {
567 567 struct device_node *dma_node = NULL;
568 568 struct device_node *dp = op->dev.of_node;
... ... @@ -632,7 +632,7 @@
632 632 };
633 633 MODULE_DEVICE_TABLE(of, esp_match);
634 634  
635   -static struct of_platform_driver esp_sbus_driver = {
  635 +static struct platform_driver esp_sbus_driver = {
636 636 .driver = {
637 637 .name = "esp",
638 638 .owner = THIS_MODULE,
639 639  
... ... @@ -644,12 +644,12 @@
644 644  
645 645 static int __init sunesp_init(void)
646 646 {
647   - return of_register_platform_driver(&esp_sbus_driver);
  647 + return platform_driver_register(&esp_sbus_driver);
648 648 }
649 649  
650 650 static void __exit sunesp_exit(void)
651 651 {
652   - of_unregister_platform_driver(&esp_sbus_driver);
  652 + platform_driver_unregister(&esp_sbus_driver);
653 653 }
654 654  
655 655 MODULE_DESCRIPTION("Sun ESP SCSI driver");