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

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>

+133 -148
+3 -3
arch/sparc/include/asm/parport.h
··· 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 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 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 */
+3 -4
arch/sparc/kernel/apc.c
··· 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 ··· 173 174 }; 174 175 MODULE_DEVICE_TABLE(of, apc_match); 175 176 176 - static struct of_platform_driver apc_driver = { 177 + static struct platform_driver apc_driver = { 177 178 .driver = { 178 179 .name = "apc", 179 180 .owner = THIS_MODULE, ··· 184 185 185 186 static int __init apc_init(void) 186 187 { 187 - return of_register_platform_driver(&apc_driver); 188 + return platform_driver_register(&apc_driver); 188 189 } 189 190 190 191 /* This driver is not critical to the boot process
+3 -4
arch/sparc/kernel/auxio_64.c
··· 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; ··· 131 132 return 0; 132 133 } 133 134 134 - static struct of_platform_driver auxio_driver = { 135 + static struct platform_driver auxio_driver = { 135 136 .probe = auxio_probe, 136 137 .driver = { 137 138 .name = "auxio", ··· 142 143 143 144 static int __init auxio_init(void) 144 145 { 145 - return of_register_platform_driver(&auxio_driver); 146 + return platform_driver_register(&auxio_driver); 146 147 } 147 148 148 149 /* Must be after subsys_initcall() so that busses are probed. Must
+6 -8
arch/sparc/kernel/central.c
··· 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; ··· 147 148 {}, 148 149 }; 149 150 150 - static struct of_platform_driver clock_board_driver = { 151 + static struct platform_driver clock_board_driver = { 151 152 .probe = clock_board_probe, 152 153 .driver = { 153 154 .name = "clock_board", ··· 156 157 }, 157 158 }; 158 159 159 - static int __devinit fhc_probe(struct platform_device *op, 160 - const struct of_device_id *match) 160 + static int __devinit fhc_probe(struct platform_device *op) 161 161 { 162 162 struct fhc *p = kzalloc(sizeof(*p), GFP_KERNEL); 163 163 int err = -ENOMEM; ··· 252 254 {}, 253 255 }; 254 256 255 - static struct of_platform_driver fhc_driver = { 257 + static struct platform_driver fhc_driver = { 256 258 .probe = fhc_probe, 257 259 .driver = { 258 260 .name = "fhc", ··· 263 265 264 266 static int __init sunfire_init(void) 265 267 { 266 - (void) of_register_platform_driver(&fhc_driver); 267 - (void) of_register_platform_driver(&clock_board_driver); 268 + (void) platform_driver_register(&fhc_driver); 269 + (void) platform_driver_register(&clock_board_driver); 268 270 return 0; 269 271 } 270 272
+8 -11
arch/sparc/kernel/chmc.c
··· 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; ··· 689 690 chmc_read_mcreg(p, CHMCTRL_DECODE4)); 690 691 } 691 692 692 - static int __devinit chmc_probe(struct platform_device *op, 693 - const struct of_device_id *match) 693 + static int __devinit chmc_probe(struct platform_device *op) 694 694 { 695 695 struct device_node *dp = op->dev.of_node; 696 696 unsigned long ver; ··· 763 765 goto out; 764 766 } 765 767 766 - static int __devinit us3mc_probe(struct platform_device *op, 767 - const struct of_device_id *match) 768 + static int __devinit us3mc_probe(struct platform_device *op) 768 769 { 769 770 if (mc_type == MC_TYPE_SAFARI) 770 - return chmc_probe(op, match); 771 + return chmc_probe(op); 771 772 else if (mc_type == MC_TYPE_JBUS) 772 - return jbusmc_probe(op, match); 773 + return jbusmc_probe(op); 773 774 return -ENODEV; 774 775 } 775 776 ··· 807 810 }; 808 811 MODULE_DEVICE_TABLE(of, us3mc_match); 809 812 810 - static struct of_platform_driver us3mc_driver = { 813 + static struct platform_driver us3mc_driver = { 811 814 .driver = { 812 815 .name = "us3mc", 813 816 .owner = THIS_MODULE, ··· 845 848 ret = register_dimm_printer(us3mc_dimm_printer); 846 849 847 850 if (!ret) { 848 - ret = of_register_platform_driver(&us3mc_driver); 851 + ret = platform_driver_register(&us3mc_driver); 849 852 if (ret) 850 853 unregister_dimm_printer(us3mc_dimm_printer); 851 854 } ··· 856 859 { 857 860 if (us3mc_platform()) { 858 861 unregister_dimm_printer(us3mc_dimm_printer); 859 - of_unregister_platform_driver(&us3mc_driver); 862 + platform_driver_unregister(&us3mc_driver); 860 863 } 861 864 } 862 865
+3 -4
arch/sparc/kernel/pci_fire.c
··· 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; ··· 506 507 {}, 507 508 }; 508 509 509 - static struct of_platform_driver fire_driver = { 510 + static struct platform_driver fire_driver = { 510 511 .driver = { 511 512 .name = DRIVER_NAME, 512 513 .owner = THIS_MODULE, ··· 517 518 518 519 static int __init fire_init(void) 519 520 { 520 - return of_register_platform_driver(&fire_driver); 521 + return platform_driver_register(&fire_driver); 521 522 } 522 523 523 524 subsys_initcall(fire_init);
+3 -4
arch/sparc/kernel/pci_psycho.c
··· 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; ··· 600 601 {}, 601 602 }; 602 603 603 - static struct of_platform_driver psycho_driver = { 604 + static struct platform_driver psycho_driver = { 604 605 .driver = { 605 606 .name = DRIVER_NAME, 606 607 .owner = THIS_MODULE, ··· 611 612 612 613 static int __init psycho_init(void) 613 614 { 614 - return of_register_platform_driver(&psycho_driver); 615 + return platform_driver_register(&psycho_driver); 615 616 } 616 617 617 618 subsys_initcall(psycho_init);
+4 -5
arch/sparc/kernel/pci_sabre.c
··· 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; ··· 463 464 const u32 *vdma; 464 465 u64 clear_irq; 465 466 466 - hummingbird_p = (match->data != NULL); 467 + hummingbird_p = op->dev.of_match && (op->dev.of_match->data != NULL); 467 468 if (!hummingbird_p) { 468 469 struct device_node *cpu_dp; 469 470 ··· 594 595 {}, 595 596 }; 596 597 597 - static struct of_platform_driver sabre_driver = { 598 + static struct platform_driver sabre_driver = { 598 599 .driver = { 599 600 .name = DRIVER_NAME, 600 601 .owner = THIS_MODULE, ··· 605 606 606 607 static int __init sabre_init(void) 607 608 { 608 - return of_register_platform_driver(&sabre_driver); 609 + return platform_driver_register(&sabre_driver); 609 610 } 610 611 611 612 subsys_initcall(sabre_init);
+6 -5
arch/sparc/kernel/pci_schizo.c
··· 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 ··· 1491 1490 {}, 1492 1491 }; 1493 1492 1494 - static struct of_platform_driver schizo_driver = { 1493 + static struct platform_driver schizo_driver = { 1495 1494 .driver = { 1496 1495 .name = DRIVER_NAME, 1497 1496 .owner = THIS_MODULE, ··· 1502 1501 1503 1502 static int __init schizo_init(void) 1504 1503 { 1505 - return of_register_platform_driver(&schizo_driver); 1504 + return platform_driver_register(&schizo_driver); 1506 1505 } 1507 1506 1508 1507 subsys_initcall(schizo_init);
+3 -4
arch/sparc/kernel/pci_sun4v.c
··· 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; ··· 1007 1008 {}, 1008 1009 }; 1009 1010 1010 - static struct of_platform_driver pci_sun4v_driver = { 1011 + static struct platform_driver pci_sun4v_driver = { 1011 1012 .driver = { 1012 1013 .name = DRIVER_NAME, 1013 1014 .owner = THIS_MODULE, ··· 1018 1019 1019 1020 static int __init pci_sun4v_init(void) 1020 1021 { 1021 - return of_register_platform_driver(&pci_sun4v_driver); 1022 + return platform_driver_register(&pci_sun4v_driver); 1022 1023 } 1023 1024 1024 1025 subsys_initcall(pci_sun4v_init);
+3 -4
arch/sparc/kernel/pmc.c
··· 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); ··· 77 78 }; 78 79 MODULE_DEVICE_TABLE(of, pmc_match); 79 80 80 - static struct of_platform_driver pmc_driver = { 81 + static struct platform_driver pmc_driver = { 81 82 .driver = { 82 83 .name = "pmc", 83 84 .owner = THIS_MODULE, ··· 88 89 89 90 static int __init pmc_init(void) 90 91 { 91 - return of_register_platform_driver(&pmc_driver); 92 + return platform_driver_register(&pmc_driver); 92 93 } 93 94 94 95 /* This driver is not critical to the boot process
+3 -3
arch/sparc/kernel/power.c
··· 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 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 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);
+3 -3
arch/sparc/kernel/time_32.c
··· 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 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 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
+9 -9
arch/sparc/kernel/time_64.c
··· 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 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 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 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 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 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 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 }
+9 -7
drivers/char/hw_random/n2-drv.c
··· 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; ··· 752 750 }; 753 751 MODULE_DEVICE_TABLE(of, n2rng_match); 754 752 755 - static struct of_platform_driver n2rng_driver = { 753 + static struct platform_driver n2rng_driver = { 756 754 .driver = { 757 755 .name = "n2rng", 758 756 .owner = THIS_MODULE, ··· 764 762 765 763 static int __init n2rng_init(void) 766 764 { 767 - return of_register_platform_driver(&n2rng_driver); 765 + return platform_driver_register(&n2rng_driver); 768 766 } 769 767 770 768 static void __exit n2rng_exit(void) 771 769 { 772 - of_unregister_platform_driver(&n2rng_driver); 770 + platform_driver_unregister(&n2rng_driver); 773 771 } 774 772 775 773 module_init(n2rng_init);
+9 -11
drivers/crypto/n2_core.c
··· 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; ··· 2115 2116 kfree(mp); 2116 2117 } 2117 2118 2118 - static int __devinit n2_mau_probe(struct platform_device *dev, 2119 - const struct of_device_id *match) 2119 + static int __devinit n2_mau_probe(struct platform_device *dev) 2120 2120 { 2121 2121 struct mdesc_handle *mdesc; 2122 2122 const char *full_name; ··· 2209 2211 2210 2212 MODULE_DEVICE_TABLE(of, n2_crypto_match); 2211 2213 2212 - static struct of_platform_driver n2_crypto_driver = { 2214 + static struct platform_driver n2_crypto_driver = { 2213 2215 .driver = { 2214 2216 .name = "n2cp", 2215 2217 .owner = THIS_MODULE, ··· 2233 2235 2234 2236 MODULE_DEVICE_TABLE(of, n2_mau_match); 2235 2237 2236 - static struct of_platform_driver n2_mau_driver = { 2238 + static struct platform_driver n2_mau_driver = { 2237 2239 .driver = { 2238 2240 .name = "ncp", 2239 2241 .owner = THIS_MODULE, ··· 2245 2247 2246 2248 static int __init n2_init(void) 2247 2249 { 2248 - int err = of_register_platform_driver(&n2_crypto_driver); 2250 + int err = platform_driver_register(&n2_crypto_driver); 2249 2251 2250 2252 if (!err) { 2251 - err = of_register_platform_driver(&n2_mau_driver); 2253 + err = platform_driver_register(&n2_mau_driver); 2252 2254 if (err) 2253 - of_unregister_platform_driver(&n2_crypto_driver); 2255 + platform_driver_unregister(&n2_crypto_driver); 2254 2256 } 2255 2257 return err; 2256 2258 } 2257 2259 2258 2260 static void __exit n2_exit(void) 2259 2261 { 2260 - of_unregister_platform_driver(&n2_mau_driver); 2261 - of_unregister_platform_driver(&n2_crypto_driver); 2262 + platform_driver_unregister(&n2_mau_driver); 2263 + platform_driver_unregister(&n2_crypto_driver); 2262 2264 } 2263 2265 2264 2266 module_init(n2_init);
+4 -5
drivers/hwmon/ultra45_env.c
··· 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; ··· 298 299 }; 299 300 MODULE_DEVICE_TABLE(of, env_match); 300 301 301 - static struct of_platform_driver env_driver = { 302 + static struct platform_driver env_driver = { 302 303 .driver = { 303 304 .name = "ultra45_env", 304 305 .owner = THIS_MODULE, ··· 310 311 311 312 static int __init env_init(void) 312 313 { 313 - return of_register_platform_driver(&env_driver); 314 + return platform_driver_register(&env_driver); 314 315 } 315 316 316 317 static void __exit env_exit(void) 317 318 { 318 - of_unregister_platform_driver(&env_driver); 319 + platform_driver_unregister(&env_driver); 319 320 } 320 321 321 322 module_init(env_init);
+10 -12
drivers/input/misc/sparcspkr.c
··· 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; ··· 256 258 {}, 257 259 }; 258 260 259 - static struct of_platform_driver bbc_beep_driver = { 261 + static struct platform_driver bbc_beep_driver = { 260 262 .driver = { 261 263 .name = "bbcbeep", 262 264 .owner = THIS_MODULE, ··· 267 269 .shutdown = sparcspkr_shutdown, 268 270 }; 269 271 270 - static int __devinit grover_beep_probe(struct platform_device *op, const struct of_device_id *match) 272 + static int __devinit grover_beep_probe(struct platform_device *op) 271 273 { 272 274 struct sparcspkr_state *state; 273 275 struct grover_beep_info *info; ··· 338 340 {}, 339 341 }; 340 342 341 - static struct of_platform_driver grover_beep_driver = { 343 + static struct platform_driver grover_beep_driver = { 342 344 .driver = { 343 345 .name = "groverbeep", 344 346 .owner = THIS_MODULE, ··· 351 353 352 354 static int __init sparcspkr_init(void) 353 355 { 354 - int err = of_register_platform_driver(&bbc_beep_driver); 356 + int err = platform_driver_register(&bbc_beep_driver); 355 357 356 358 if (!err) { 357 - err = of_register_platform_driver(&grover_beep_driver); 359 + err = platform_driver_register(&grover_beep_driver); 358 360 if (err) 359 - of_unregister_platform_driver(&bbc_beep_driver); 361 + platform_driver_unregister(&bbc_beep_driver); 360 362 } 361 363 362 364 return err; ··· 364 366 365 367 static void __exit sparcspkr_exit(void) 366 368 { 367 - of_unregister_platform_driver(&bbc_beep_driver); 368 - of_unregister_platform_driver(&grover_beep_driver); 369 + platform_driver_unregister(&bbc_beep_driver); 370 + platform_driver_unregister(&grover_beep_driver); 369 371 } 370 372 371 373 module_init(sparcspkr_init);
+4 -4
drivers/input/serio/i8042-sparcio.h
··· 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 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 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 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 */
+4 -4
drivers/parport/parport_sunbpp.c
··· 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 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, ··· 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");
+4 -5
drivers/sbus/char/bbc_i2c.c
··· 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; ··· 412 413 }; 413 414 MODULE_DEVICE_TABLE(of, bbc_i2c_match); 414 415 415 - static struct of_platform_driver bbc_i2c_driver = { 416 + static struct platform_driver bbc_i2c_driver = { 416 417 .driver = { 417 418 .name = "bbc_i2c", 418 419 .owner = THIS_MODULE, ··· 424 425 425 426 static int __init bbc_i2c_init(void) 426 427 { 427 - return of_register_platform_driver(&bbc_i2c_driver); 428 + return platform_driver_register(&bbc_i2c_driver); 428 429 } 429 430 430 431 static void __exit bbc_i2c_exit(void) 431 432 { 432 - of_unregister_platform_driver(&bbc_i2c_driver); 433 + platform_driver_unregister(&bbc_i2c_driver); 433 434 } 434 435 435 436 module_init(bbc_i2c_init);
+4 -5
drivers/sbus/char/display7seg.c
··· 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; ··· 265 266 }; 266 267 MODULE_DEVICE_TABLE(of, d7s_match); 267 268 268 - static struct of_platform_driver d7s_driver = { 269 + static struct platform_driver d7s_driver = { 269 270 .driver = { 270 271 .name = DRIVER_NAME, 271 272 .owner = THIS_MODULE, ··· 277 278 278 279 static int __init d7s_init(void) 279 280 { 280 - return of_register_platform_driver(&d7s_driver); 281 + return platform_driver_register(&d7s_driver); 281 282 } 282 283 283 284 static void __exit d7s_exit(void) 284 285 { 285 - of_unregister_platform_driver(&d7s_driver); 286 + platform_driver_unregister(&d7s_driver); 286 287 } 287 288 288 289 module_init(d7s_init);
+4 -5
drivers/sbus/char/envctrl.c
··· 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; ··· 1128 1129 }; 1129 1130 MODULE_DEVICE_TABLE(of, envctrl_match); 1130 1131 1131 - static struct of_platform_driver envctrl_driver = { 1132 + static struct platform_driver envctrl_driver = { 1132 1133 .driver = { 1133 1134 .name = DRIVER_NAME, 1134 1135 .owner = THIS_MODULE, ··· 1140 1141 1141 1142 static int __init envctrl_init(void) 1142 1143 { 1143 - return of_register_platform_driver(&envctrl_driver); 1144 + return platform_driver_register(&envctrl_driver); 1144 1145 } 1145 1146 1146 1147 static void __exit envctrl_exit(void) 1147 1148 { 1148 - of_unregister_platform_driver(&envctrl_driver); 1149 + platform_driver_unregister(&envctrl_driver); 1149 1150 } 1150 1151 1151 1152 module_init(envctrl_init);
+4 -5
drivers/sbus/char/flash.c
··· 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; ··· 206 207 }; 207 208 MODULE_DEVICE_TABLE(of, flash_match); 208 209 209 - static struct of_platform_driver flash_driver = { 210 + static struct platform_driver flash_driver = { 210 211 .driver = { 211 212 .name = "flash", 212 213 .owner = THIS_MODULE, ··· 218 219 219 220 static int __init flash_init(void) 220 221 { 221 - return of_register_platform_driver(&flash_driver); 222 + return platform_driver_register(&flash_driver); 222 223 } 223 224 224 225 static void __exit flash_cleanup(void) 225 226 { 226 - of_unregister_platform_driver(&flash_driver); 227 + platform_driver_unregister(&flash_driver); 227 228 } 228 229 229 230 module_init(flash_init);
+4 -5
drivers/sbus/char/uctrl.c
··· 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; ··· 424 425 }; 425 426 MODULE_DEVICE_TABLE(of, uctrl_match); 426 427 427 - static struct of_platform_driver uctrl_driver = { 428 + static struct platform_driver uctrl_driver = { 428 429 .driver = { 429 430 .name = "uctrl", 430 431 .owner = THIS_MODULE, ··· 437 438 438 439 static int __init uctrl_init(void) 439 440 { 440 - return of_register_platform_driver(&uctrl_driver); 441 + return platform_driver_register(&uctrl_driver); 441 442 } 442 443 443 444 static void __exit uctrl_exit(void) 444 445 { 445 - of_unregister_platform_driver(&uctrl_driver); 446 + platform_driver_unregister(&uctrl_driver); 446 447 } 447 448 448 449 module_init(uctrl_init);
+9 -5
drivers/scsi/qlogicpti.c
··· 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 + 1304 + if (!op->dev.of_match) 1305 + return -EINVAL; 1306 + tpnt = op->dev.of_match->data; 1303 1307 1304 1308 /* Sometimes Antares cards come up not completely 1305 1309 * setup, and we get a report of a zero IRQ. ··· 1461 1457 }; 1462 1458 MODULE_DEVICE_TABLE(of, qpti_match); 1463 1459 1464 - static struct of_platform_driver qpti_sbus_driver = { 1460 + static struct platform_driver qpti_sbus_driver = { 1465 1461 .driver = { 1466 1462 .name = "qpti", 1467 1463 .owner = THIS_MODULE, ··· 1473 1469 1474 1470 static int __init qpti_init(void) 1475 1471 { 1476 - return of_register_platform_driver(&qpti_sbus_driver); 1472 + return platform_driver_register(&qpti_sbus_driver); 1477 1473 } 1478 1474 1479 1475 static void __exit qpti_exit(void) 1480 1476 { 1481 - of_unregister_platform_driver(&qpti_sbus_driver); 1477 + platform_driver_unregister(&qpti_sbus_driver); 1482 1478 } 1483 1479 1484 1480 MODULE_DESCRIPTION("QlogicISP SBUS driver");
+4 -4
drivers/scsi/sun_esp.c
··· 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 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, ··· 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");