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

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

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

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

+120 -161
+3 -4
arch/powerpc/kernel/of_platform.c
··· 36 36 * lacking some bits needed here. 37 37 */ 38 38 39 - static int __devinit of_pci_phb_probe(struct platform_device *dev, 40 - const struct of_device_id *match) 39 + static int __devinit of_pci_phb_probe(struct platform_device *dev) 41 40 { 42 41 struct pci_controller *phb; 43 42 ··· 103 104 {} 104 105 }; 105 106 106 - static struct of_platform_driver of_pci_phb_driver = { 107 + static struct platform_driver of_pci_phb_driver = { 107 108 .probe = of_pci_phb_probe, 108 109 .driver = { 109 110 .name = "of-pci", ··· 114 115 115 116 static __init int of_pci_phb_init(void) 116 117 { 117 - return of_register_platform_driver(&of_pci_phb_driver); 118 + return platform_driver_register(&of_pci_phb_driver); 118 119 } 119 120 120 121 device_initcall(of_pci_phb_init);
+6 -8
arch/powerpc/platforms/52xx/mpc52xx_gpio.c
··· 147 147 return 0; 148 148 } 149 149 150 - static int __devinit mpc52xx_wkup_gpiochip_probe(struct platform_device *ofdev, 151 - const struct of_device_id *match) 150 + static int __devinit mpc52xx_wkup_gpiochip_probe(struct platform_device *ofdev) 152 151 { 153 152 struct mpc52xx_gpiochip *chip; 154 153 struct mpc52xx_gpio_wkup __iomem *regs; ··· 190 191 {} 191 192 }; 192 193 193 - static struct of_platform_driver mpc52xx_wkup_gpiochip_driver = { 194 + static struct platform_driver mpc52xx_wkup_gpiochip_driver = { 194 195 .driver = { 195 196 .name = "gpio_wkup", 196 197 .owner = THIS_MODULE, ··· 309 310 return 0; 310 311 } 311 312 312 - static int __devinit mpc52xx_simple_gpiochip_probe(struct platform_device *ofdev, 313 - const struct of_device_id *match) 313 + static int __devinit mpc52xx_simple_gpiochip_probe(struct platform_device *ofdev) 314 314 { 315 315 struct mpc52xx_gpiochip *chip; 316 316 struct gpio_chip *gc; ··· 347 349 {} 348 350 }; 349 351 350 - static struct of_platform_driver mpc52xx_simple_gpiochip_driver = { 352 + static struct platform_driver mpc52xx_simple_gpiochip_driver = { 351 353 .driver = { 352 354 .name = "gpio", 353 355 .owner = THIS_MODULE, ··· 359 361 360 362 static int __init mpc52xx_gpio_init(void) 361 363 { 362 - if (of_register_platform_driver(&mpc52xx_wkup_gpiochip_driver)) 364 + if (platform_driver_register(&mpc52xx_wkup_gpiochip_driver)) 363 365 printk(KERN_ERR "Unable to register wakeup GPIO driver\n"); 364 366 365 - if (of_register_platform_driver(&mpc52xx_simple_gpiochip_driver)) 367 + if (platform_driver_register(&mpc52xx_simple_gpiochip_driver)) 366 368 printk(KERN_ERR "Unable to register simple GPIO driver\n"); 367 369 368 370 return 0;
+3 -7
arch/powerpc/platforms/52xx/mpc52xx_gpt.c
··· 721 721 /* --------------------------------------------------------------------- 722 722 * of_platform bus binding code 723 723 */ 724 - static int __devinit mpc52xx_gpt_probe(struct platform_device *ofdev, 725 - const struct of_device_id *match) 724 + static int __devinit mpc52xx_gpt_probe(struct platform_device *ofdev) 726 725 { 727 726 struct mpc52xx_gpt_priv *gpt; 728 727 ··· 780 781 {} 781 782 }; 782 783 783 - static struct of_platform_driver mpc52xx_gpt_driver = { 784 + static struct platform_driver mpc52xx_gpt_driver = { 784 785 .driver = { 785 786 .name = "mpc52xx-gpt", 786 787 .owner = THIS_MODULE, ··· 792 793 793 794 static int __init mpc52xx_gpt_init(void) 794 795 { 795 - if (of_register_platform_driver(&mpc52xx_gpt_driver)) 796 - pr_err("error registering MPC52xx GPT driver\n"); 797 - 798 - return 0; 796 + return platform_driver_register(&mpc52xx_gpt_driver); 799 797 } 800 798 801 799 /* Make sure GPIOs and IRQs get set up before anyone tries to use them */
+4 -7
arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c
··· 436 436 } 437 437 EXPORT_SYMBOL(mpc52xx_lpbfifo_abort); 438 438 439 - static int __devinit mpc52xx_lpbfifo_probe(struct platform_device *op, 440 - const struct of_device_id *match) 439 + static int __devinit mpc52xx_lpbfifo_probe(struct platform_device *op) 441 440 { 442 441 struct resource res; 443 442 int rc = -ENOMEM; ··· 535 536 {}, 536 537 }; 537 538 538 - static struct of_platform_driver mpc52xx_lpbfifo_driver = { 539 + static struct platform_driver mpc52xx_lpbfifo_driver = { 539 540 .driver = { 540 541 .name = "mpc52xx-lpbfifo", 541 542 .owner = THIS_MODULE, ··· 550 551 */ 551 552 static int __init mpc52xx_lpbfifo_init(void) 552 553 { 553 - pr_debug("Registering LocalPlus bus FIFO driver\n"); 554 - return of_register_platform_driver(&mpc52xx_lpbfifo_driver); 554 + return platform_driver_register(&mpc52xx_lpbfifo_driver); 555 555 } 556 556 module_init(mpc52xx_lpbfifo_init); 557 557 558 558 static void __exit mpc52xx_lpbfifo_exit(void) 559 559 { 560 - pr_debug("Unregistering LocalPlus bus FIFO driver\n"); 561 - of_unregister_platform_driver(&mpc52xx_lpbfifo_driver); 560 + platform_driver_unregister(&mpc52xx_lpbfifo_driver); 562 561 } 563 562 module_exit(mpc52xx_lpbfifo_exit);
+3 -4
arch/powerpc/platforms/82xx/ep8248e.c
··· 111 111 .ops = &ep8248e_mdio_ops, 112 112 }; 113 113 114 - static int __devinit ep8248e_mdio_probe(struct platform_device *ofdev, 115 - const struct of_device_id *match) 114 + static int __devinit ep8248e_mdio_probe(struct platform_device *ofdev) 116 115 { 117 116 struct mii_bus *bus; 118 117 struct resource res; ··· 166 167 {}, 167 168 }; 168 169 169 - static struct of_platform_driver ep8248e_mdio_driver = { 170 + static struct platform_driver ep8248e_mdio_driver = { 170 171 .driver = { 171 172 .name = "ep8248e-mdio-bitbang", 172 173 .owner = THIS_MODULE, ··· 307 308 static int __init declare_of_platform_devices(void) 308 309 { 309 310 of_platform_bus_probe(NULL, of_bus_ids, NULL); 310 - of_register_platform_driver(&ep8248e_mdio_driver); 311 + platform_driver_register(&ep8248e_mdio_driver); 311 312 312 313 return 0; 313 314 }
+9 -5
arch/powerpc/platforms/83xx/suspend.c
··· 318 318 .end = mpc83xx_suspend_end, 319 319 }; 320 320 321 - static int pmc_probe(struct platform_device *ofdev, 322 - const struct of_device_id *match) 321 + static int pmc_probe(struct platform_device *ofdev) 323 322 { 324 323 struct device_node *np = ofdev->dev.of_node; 325 324 struct resource res; 326 - struct pmc_type *type = match->data; 325 + struct pmc_type *type; 327 326 int ret = 0; 327 + 328 + if (!ofdev->dev.of_match) 329 + return -EINVAL; 330 + 331 + type = ofdev->dev.of_match->data; 328 332 329 333 if (!of_device_is_available(np)) 330 334 return -ENODEV; ··· 426 422 {} 427 423 }; 428 424 429 - static struct of_platform_driver pmc_driver = { 425 + static struct platform_driver pmc_driver = { 430 426 .driver = { 431 427 .name = "mpc83xx-pmc", 432 428 .owner = THIS_MODULE, ··· 438 434 439 435 static int pmc_init(void) 440 436 { 441 - return of_register_platform_driver(&pmc_driver); 437 + return platform_driver_register(&pmc_driver); 442 438 } 443 439 444 440 module_init(pmc_init);
+4 -7
arch/powerpc/platforms/cell/axon_msi.c
··· 328 328 .map = msic_host_map, 329 329 }; 330 330 331 - static int axon_msi_shutdown(struct platform_device *device) 331 + static void axon_msi_shutdown(struct platform_device *device) 332 332 { 333 333 struct axon_msic *msic = dev_get_drvdata(&device->dev); 334 334 u32 tmp; ··· 338 338 tmp = dcr_read(msic->dcr_host, MSIC_CTRL_REG); 339 339 tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE; 340 340 msic_dcr_write(msic, MSIC_CTRL_REG, tmp); 341 - 342 - return 0; 343 341 } 344 342 345 - static int axon_msi_probe(struct platform_device *device, 346 - const struct of_device_id *device_id) 343 + static int axon_msi_probe(struct platform_device *device) 347 344 { 348 345 struct device_node *dn = device->dev.of_node; 349 346 struct axon_msic *msic; ··· 443 446 {} 444 447 }; 445 448 446 - static struct of_platform_driver axon_msi_driver = { 449 + static struct platform_driver axon_msi_driver = { 447 450 .probe = axon_msi_probe, 448 451 .shutdown = axon_msi_shutdown, 449 452 .driver = { ··· 455 458 456 459 static int __init axon_msi_init(void) 457 460 { 458 - return of_register_platform_driver(&axon_msi_driver); 461 + return platform_driver_register(&axon_msi_driver); 459 462 } 460 463 subsys_initcall(axon_msi_init); 461 464
+4 -5
arch/powerpc/platforms/pasemi/gpio_mdio.c
··· 216 216 } 217 217 218 218 219 - static int __devinit gpio_mdio_probe(struct platform_device *ofdev, 220 - const struct of_device_id *match) 219 + static int __devinit gpio_mdio_probe(struct platform_device *ofdev) 221 220 { 222 221 struct device *dev = &ofdev->dev; 223 222 struct device_node *np = ofdev->dev.of_node; ··· 298 299 }; 299 300 MODULE_DEVICE_TABLE(of, gpio_mdio_match); 300 301 301 - static struct of_platform_driver gpio_mdio_driver = 302 + static struct platform_driver gpio_mdio_driver = 302 303 { 303 304 .probe = gpio_mdio_probe, 304 305 .remove = gpio_mdio_remove, ··· 325 326 if (!gpio_regs) 326 327 return -ENODEV; 327 328 328 - return of_register_platform_driver(&gpio_mdio_driver); 329 + return platform_driver_register(&gpio_mdio_driver); 329 330 } 330 331 module_init(gpio_mdio_init); 331 332 332 333 void gpio_mdio_exit(void) 333 334 { 334 - of_unregister_platform_driver(&gpio_mdio_driver); 335 + platform_driver_unregister(&gpio_mdio_driver); 335 336 if (gpio_regs) 336 337 iounmap(gpio_regs); 337 338 }
+5 -6
arch/powerpc/sysdev/axonram.c
··· 172 172 173 173 /** 174 174 * axon_ram_probe - probe() method for platform driver 175 - * @device, @device_id: see of_platform_driver method 175 + * @device: see platform_driver method 176 176 */ 177 - static int axon_ram_probe(struct platform_device *device, 178 - const struct of_device_id *device_id) 177 + static int axon_ram_probe(struct platform_device *device) 179 178 { 180 179 static int axon_ram_bank_id = -1; 181 180 struct axon_ram_bank *bank; ··· 325 326 {} 326 327 }; 327 328 328 - static struct of_platform_driver axon_ram_driver = { 329 + static struct platform_driver axon_ram_driver = { 329 330 .probe = axon_ram_probe, 330 331 .remove = axon_ram_remove, 331 332 .driver = { ··· 349 350 } 350 351 azfs_minor = 0; 351 352 352 - return of_register_platform_driver(&axon_ram_driver); 353 + return platform_driver_register(&axon_ram_driver); 353 354 } 354 355 355 356 /** ··· 358 359 static void __exit 359 360 axon_ram_exit(void) 360 361 { 361 - of_unregister_platform_driver(&axon_ram_driver); 362 + platform_driver_unregister(&axon_ram_driver); 362 363 unregister_blkdev(azfs_major, AXON_RAM_DEVICE_NAME); 363 364 } 364 365
+4 -5
arch/powerpc/sysdev/bestcomm/bestcomm.c
··· 365 365 /* OF platform driver */ 366 366 /* ======================================================================== */ 367 367 368 - static int __devinit mpc52xx_bcom_probe(struct platform_device *op, 369 - const struct of_device_id *match) 368 + static int __devinit mpc52xx_bcom_probe(struct platform_device *op) 370 369 { 371 370 struct device_node *ofn_sram; 372 371 struct resource res_bcom; ··· 491 492 MODULE_DEVICE_TABLE(of, mpc52xx_bcom_of_match); 492 493 493 494 494 - static struct of_platform_driver mpc52xx_bcom_of_platform_driver = { 495 + static struct platform_driver mpc52xx_bcom_of_platform_driver = { 495 496 .probe = mpc52xx_bcom_probe, 496 497 .remove = mpc52xx_bcom_remove, 497 498 .driver = { ··· 509 510 static int __init 510 511 mpc52xx_bcom_init(void) 511 512 { 512 - return of_register_platform_driver(&mpc52xx_bcom_of_platform_driver); 513 + return platform_driver_register(&mpc52xx_bcom_of_platform_driver); 513 514 } 514 515 515 516 static void __exit 516 517 mpc52xx_bcom_exit(void) 517 518 { 518 - of_unregister_platform_driver(&mpc52xx_bcom_of_platform_driver); 519 + platform_driver_unregister(&mpc52xx_bcom_of_platform_driver); 519 520 } 520 521 521 522 /* If we're not a module, we must make sure everything is setup before */
+4 -5
arch/powerpc/sysdev/fsl_85xx_l2ctlr.c
··· 71 71 __setup("cache-sram-size=", get_size_from_cmdline); 72 72 __setup("cache-sram-offset=", get_offset_from_cmdline); 73 73 74 - static int __devinit mpc85xx_l2ctlr_of_probe(struct platform_device *dev, 75 - const struct of_device_id *match) 74 + static int __devinit mpc85xx_l2ctlr_of_probe(struct platform_device *dev) 76 75 { 77 76 long rval; 78 77 unsigned int rem; ··· 203 204 {}, 204 205 }; 205 206 206 - static struct of_platform_driver mpc85xx_l2ctlr_of_platform_driver = { 207 + static struct platform_driver mpc85xx_l2ctlr_of_platform_driver = { 207 208 .driver = { 208 209 .name = "fsl-l2ctlr", 209 210 .owner = THIS_MODULE, ··· 215 216 216 217 static __init int mpc85xx_l2ctlr_of_init(void) 217 218 { 218 - return of_register_platform_driver(&mpc85xx_l2ctlr_of_platform_driver); 219 + return platform_driver_register(&mpc85xx_l2ctlr_of_platform_driver); 219 220 } 220 221 221 222 static void __exit mpc85xx_l2ctlr_of_exit(void) 222 223 { 223 - of_unregister_platform_driver(&mpc85xx_l2ctlr_of_platform_driver); 224 + platform_driver_unregister(&mpc85xx_l2ctlr_of_platform_driver); 224 225 } 225 226 226 227 subsys_initcall(mpc85xx_l2ctlr_of_init);
+8 -5
arch/powerpc/sysdev/fsl_msi.c
··· 273 273 return 0; 274 274 } 275 275 276 - static int __devinit fsl_of_msi_probe(struct platform_device *dev, 277 - const struct of_device_id *match) 276 + static int __devinit fsl_of_msi_probe(struct platform_device *dev) 278 277 { 279 278 struct fsl_msi *msi; 280 279 struct resource res; ··· 281 282 int rc; 282 283 int virt_msir; 283 284 const u32 *p; 284 - struct fsl_msi_feature *features = match->data; 285 + struct fsl_msi_feature *features; 285 286 struct fsl_msi_cascade_data *cascade_data = NULL; 286 287 int len; 287 288 u32 offset; 289 + 290 + if (!dev->dev.of_match) 291 + return -EINVAL; 292 + features = dev->dev.of_match->data; 288 293 289 294 printk(KERN_DEBUG "Setting up Freescale MSI support\n"); 290 295 ··· 414 411 {} 415 412 }; 416 413 417 - static struct of_platform_driver fsl_of_msi_driver = { 414 + static struct platform_driver fsl_of_msi_driver = { 418 415 .driver = { 419 416 .name = "fsl-msi", 420 417 .owner = THIS_MODULE, ··· 426 423 427 424 static __init int fsl_of_msi_init(void) 428 425 { 429 - return of_register_platform_driver(&fsl_of_msi_driver); 426 + return platform_driver_register(&fsl_of_msi_driver); 430 427 } 431 428 432 429 subsys_initcall(fsl_of_msi_init);
+3 -4
arch/powerpc/sysdev/fsl_pmc.c
··· 58 58 .enter = pmc_suspend_enter, 59 59 }; 60 60 61 - static int pmc_probe(struct platform_device *ofdev, 62 - const struct of_device_id *id) 61 + static int pmc_probe(struct platform_device *ofdev) 63 62 { 64 63 pmc_regs = of_iomap(ofdev->dev.of_node, 0); 65 64 if (!pmc_regs) ··· 75 76 { }, 76 77 }; 77 78 78 - static struct of_platform_driver pmc_driver = { 79 + static struct platform_driver pmc_driver = { 79 80 .driver = { 80 81 .name = "fsl-pmc", 81 82 .owner = THIS_MODULE, ··· 86 87 87 88 static int __init pmc_init(void) 88 89 { 89 - return of_register_platform_driver(&pmc_driver); 90 + return platform_driver_register(&pmc_driver); 90 91 } 91 92 device_initcall(pmc_init);
+3 -4
arch/powerpc/sysdev/fsl_rio.c
··· 1570 1570 1571 1571 /* The probe function for RapidIO peer-to-peer network. 1572 1572 */ 1573 - static int __devinit fsl_of_rio_rpn_probe(struct platform_device *dev, 1574 - const struct of_device_id *match) 1573 + static int __devinit fsl_of_rio_rpn_probe(struct platform_device *dev) 1575 1574 { 1576 1575 int rc; 1577 1576 printk(KERN_INFO "Setting up RapidIO peer-to-peer network %s\n", ··· 1593 1594 {}, 1594 1595 }; 1595 1596 1596 - static struct of_platform_driver fsl_of_rio_rpn_driver = { 1597 + static struct platform_driver fsl_of_rio_rpn_driver = { 1597 1598 .driver = { 1598 1599 .name = "fsl-of-rio", 1599 1600 .owner = THIS_MODULE, ··· 1604 1605 1605 1606 static __init int fsl_of_rio_rpn_init(void) 1606 1607 { 1607 - return of_register_platform_driver(&fsl_of_rio_rpn_driver); 1608 + return platform_driver_register(&fsl_of_rio_rpn_driver); 1608 1609 } 1609 1610 1610 1611 subsys_initcall(fsl_of_rio_rpn_init);
+4 -5
arch/powerpc/sysdev/pmi.c
··· 121 121 spin_unlock(&data->handler_spinlock); 122 122 } 123 123 124 - static int pmi_of_probe(struct platform_device *dev, 125 - const struct of_device_id *match) 124 + static int pmi_of_probe(struct platform_device *dev) 126 125 { 127 126 struct device_node *np = dev->dev.of_node; 128 127 int rc; ··· 204 205 return 0; 205 206 } 206 207 207 - static struct of_platform_driver pmi_of_platform_driver = { 208 + static struct platform_driver pmi_of_platform_driver = { 208 209 .probe = pmi_of_probe, 209 210 .remove = pmi_of_remove, 210 211 .driver = { ··· 216 217 217 218 static int __init pmi_module_init(void) 218 219 { 219 - return of_register_platform_driver(&pmi_of_platform_driver); 220 + return platform_driver_register(&pmi_of_platform_driver); 220 221 } 221 222 module_init(pmi_module_init); 222 223 223 224 static void __exit pmi_module_exit(void) 224 225 { 225 - of_unregister_platform_driver(&pmi_of_platform_driver); 226 + platform_driver_unregister(&pmi_of_platform_driver); 226 227 } 227 228 module_exit(pmi_module_exit); 228 229
+3 -4
arch/powerpc/sysdev/qe_lib/qe.c
··· 659 659 return 0; 660 660 } 661 661 662 - static int qe_probe(struct platform_device *ofdev, 663 - const struct of_device_id *id) 662 + static int qe_probe(struct platform_device *ofdev) 664 663 { 665 664 return 0; 666 665 } ··· 669 670 { }, 670 671 }; 671 672 672 - static struct of_platform_driver qe_driver = { 673 + static struct platform_driver qe_driver = { 673 674 .driver = { 674 675 .name = "fsl-qe", 675 676 .owner = THIS_MODULE, ··· 681 682 682 683 static int __init qe_drv_init(void) 683 684 { 684 - return of_register_platform_driver(&qe_driver); 685 + return platform_driver_register(&qe_driver); 685 686 } 686 687 device_initcall(qe_drv_init); 687 688 #endif /* defined(CONFIG_SUSPEND) && defined(CONFIG_PPC_85xx) */
+4 -5
drivers/char/hw_random/pasemi-rng.c
··· 94 94 .data_read = pasemi_rng_data_read, 95 95 }; 96 96 97 - static int __devinit rng_probe(struct platform_device *ofdev, 98 - const struct of_device_id *match) 97 + static int __devinit rng_probe(struct platform_device *ofdev) 99 98 { 100 99 void __iomem *rng_regs; 101 100 struct device_node *rng_np = ofdev->dev.of_node; ··· 138 139 { }, 139 140 }; 140 141 141 - static struct of_platform_driver rng_driver = { 142 + static struct platform_driver rng_driver = { 142 143 .driver = { 143 144 .name = "pasemi-rng", 144 145 .owner = THIS_MODULE, ··· 150 151 151 152 static int __init rng_init(void) 152 153 { 153 - return of_register_platform_driver(&rng_driver); 154 + return platform_driver_register(&rng_driver); 154 155 } 155 156 module_init(rng_init); 156 157 157 158 static void __exit rng_exit(void) 158 159 { 159 - of_unregister_platform_driver(&rng_driver); 160 + platform_driver_unregister(&rng_driver); 160 161 } 161 162 module_exit(rng_exit); 162 163
+4 -5
drivers/crypto/amcc/crypto4xx_core.c
··· 1150 1150 /** 1151 1151 * Module Initialization Routine 1152 1152 */ 1153 - static int __init crypto4xx_probe(struct platform_device *ofdev, 1154 - const struct of_device_id *match) 1153 + static int __init crypto4xx_probe(struct platform_device *ofdev) 1155 1154 { 1156 1155 int rc; 1157 1156 struct resource res; ··· 1279 1280 { }, 1280 1281 }; 1281 1282 1282 - static struct of_platform_driver crypto4xx_driver = { 1283 + static struct platform_driver crypto4xx_driver = { 1283 1284 .driver = { 1284 1285 .name = "crypto4xx", 1285 1286 .owner = THIS_MODULE, ··· 1291 1292 1292 1293 static int __init crypto4xx_init(void) 1293 1294 { 1294 - return of_register_platform_driver(&crypto4xx_driver); 1295 + return platform_driver_register(&crypto4xx_driver); 1295 1296 } 1296 1297 1297 1298 static void __exit crypto4xx_exit(void) 1298 1299 { 1299 - of_unregister_platform_driver(&crypto4xx_driver); 1300 + platform_driver_unregister(&crypto4xx_driver); 1300 1301 } 1301 1302 1302 1303 module_init(crypto4xx_init);
+3 -11
drivers/dma/fsldma.c
··· 1281 1281 kfree(chan); 1282 1282 } 1283 1283 1284 - static int __devinit fsldma_of_probe(struct platform_device *op, 1285 - const struct of_device_id *match) 1284 + static int __devinit fsldma_of_probe(struct platform_device *op) 1286 1285 { 1287 1286 struct fsldma_device *fdev; 1288 1287 struct device_node *child; ··· 1413 1414 1414 1415 static __init int fsldma_init(void) 1415 1416 { 1416 - int ret; 1417 - 1418 1417 pr_info("Freescale Elo / Elo Plus DMA driver\n"); 1419 - 1420 - ret = of_register_platform_driver(&fsldma_of_driver); 1421 - if (ret) 1422 - pr_err("fsldma: failed to register platform driver\n"); 1423 - 1424 - return ret; 1418 + return platform_driver_register(&fsldma_of_driver); 1425 1419 } 1426 1420 1427 1421 static void __exit fsldma_exit(void) 1428 1422 { 1429 - of_unregister_platform_driver(&fsldma_of_driver); 1423 + platform_driver_unregister(&fsldma_of_driver); 1430 1424 } 1431 1425 1432 1426 subsys_initcall(fsldma_init);
+4 -5
drivers/dma/mpc512x_dma.c
··· 649 649 return &mdesc->desc; 650 650 } 651 651 652 - static int __devinit mpc_dma_probe(struct platform_device *op, 653 - const struct of_device_id *match) 652 + static int __devinit mpc_dma_probe(struct platform_device *op) 654 653 { 655 654 struct device_node *dn = op->dev.of_node; 656 655 struct device *dev = &op->dev; ··· 826 827 {}, 827 828 }; 828 829 829 - static struct of_platform_driver mpc_dma_driver = { 830 + static struct platform_driver mpc_dma_driver = { 830 831 .probe = mpc_dma_probe, 831 832 .remove = __devexit_p(mpc_dma_remove), 832 833 .driver = { ··· 838 839 839 840 static int __init mpc_dma_init(void) 840 841 { 841 - return of_register_platform_driver(&mpc_dma_driver); 842 + return platform_driver_register(&mpc_dma_driver); 842 843 } 843 844 module_init(mpc_dma_init); 844 845 845 846 static void __exit mpc_dma_exit(void) 846 847 { 847 - of_unregister_platform_driver(&mpc_dma_driver); 848 + platform_driver_unregister(&mpc_dma_driver); 848 849 } 849 850 module_exit(mpc_dma_exit); 850 851
+5 -6
drivers/dma/ppc4xx/adma.c
··· 4393 4393 /** 4394 4394 * ppc440spe_adma_probe - probe the asynch device 4395 4395 */ 4396 - static int __devinit ppc440spe_adma_probe(struct platform_device *ofdev, 4397 - const struct of_device_id *match) 4396 + static int __devinit ppc440spe_adma_probe(struct platform_device *ofdev) 4398 4397 { 4399 4398 struct device_node *np = ofdev->dev.of_node; 4400 4399 struct resource res; ··· 4943 4944 }; 4944 4945 MODULE_DEVICE_TABLE(of, ppc440spe_adma_of_match); 4945 4946 4946 - static struct of_platform_driver ppc440spe_adma_driver = { 4947 + static struct platform_driver ppc440spe_adma_driver = { 4947 4948 .probe = ppc440spe_adma_probe, 4948 4949 .remove = __devexit_p(ppc440spe_adma_remove), 4949 4950 .driver = { ··· 4961 4962 if (ret) 4962 4963 return ret; 4963 4964 4964 - ret = of_register_platform_driver(&ppc440spe_adma_driver); 4965 + ret = platform_driver_register(&ppc440spe_adma_driver); 4965 4966 if (ret) { 4966 4967 pr_err("%s: failed to register platform driver\n", 4967 4968 __func__); ··· 4995 4996 /* User will not be able to enable h/w RAID-6 */ 4996 4997 pr_err("%s: failed to create RAID-6 driver interface\n", 4997 4998 __func__); 4998 - of_unregister_platform_driver(&ppc440spe_adma_driver); 4999 + platform_driver_unregister(&ppc440spe_adma_driver); 4999 5000 out_reg: 5000 5001 dcr_unmap(ppc440spe_mq_dcr_host, ppc440spe_mq_dcr_len); 5001 5002 kfree(ppc440spe_dma_fifo_buf); ··· 5010 5011 &driver_attr_enable); 5011 5012 driver_remove_file(&ppc440spe_adma_driver.driver, 5012 5013 &driver_attr_devices); 5013 - of_unregister_platform_driver(&ppc440spe_adma_driver); 5014 + platform_driver_unregister(&ppc440spe_adma_driver); 5014 5015 dcr_unmap(ppc440spe_mq_dcr_host, ppc440spe_mq_dcr_len); 5015 5016 kfree(ppc440spe_dma_fifo_buf); 5016 5017 }
+12 -15
drivers/edac/mpc85xx_edac.c
··· 200 200 return IRQ_HANDLED; 201 201 } 202 202 203 - static int __devinit mpc85xx_pci_err_probe(struct platform_device *op, 204 - const struct of_device_id *match) 203 + static int __devinit mpc85xx_pci_err_probe(struct platform_device *op) 205 204 { 206 205 struct edac_pci_ctl_info *pci; 207 206 struct mpc85xx_pci_pdata *pdata; ··· 337 338 }; 338 339 MODULE_DEVICE_TABLE(of, mpc85xx_pci_err_of_match); 339 340 340 - static struct of_platform_driver mpc85xx_pci_err_driver = { 341 + static struct platform_driver mpc85xx_pci_err_driver = { 341 342 .probe = mpc85xx_pci_err_probe, 342 343 .remove = __devexit_p(mpc85xx_pci_err_remove), 343 344 .driver = { ··· 502 503 return IRQ_HANDLED; 503 504 } 504 505 505 - static int __devinit mpc85xx_l2_err_probe(struct platform_device *op, 506 - const struct of_device_id *match) 506 + static int __devinit mpc85xx_l2_err_probe(struct platform_device *op) 507 507 { 508 508 struct edac_device_ctl_info *edac_dev; 509 509 struct mpc85xx_l2_pdata *pdata; ··· 654 656 }; 655 657 MODULE_DEVICE_TABLE(of, mpc85xx_l2_err_of_match); 656 658 657 - static struct of_platform_driver mpc85xx_l2_err_driver = { 659 + static struct platform_driver mpc85xx_l2_err_driver = { 658 660 .probe = mpc85xx_l2_err_probe, 659 661 .remove = mpc85xx_l2_err_remove, 660 662 .driver = { ··· 954 956 } 955 957 } 956 958 957 - static int __devinit mpc85xx_mc_err_probe(struct platform_device *op, 958 - const struct of_device_id *match) 959 + static int __devinit mpc85xx_mc_err_probe(struct platform_device *op) 959 960 { 960 961 struct mem_ctl_info *mci; 961 962 struct mpc85xx_mc_pdata *pdata; ··· 1133 1136 }; 1134 1137 MODULE_DEVICE_TABLE(of, mpc85xx_mc_err_of_match); 1135 1138 1136 - static struct of_platform_driver mpc85xx_mc_err_driver = { 1139 + static struct platform_driver mpc85xx_mc_err_driver = { 1137 1140 .probe = mpc85xx_mc_err_probe, 1138 1141 .remove = mpc85xx_mc_err_remove, 1139 1142 .driver = { ··· 1168 1171 break; 1169 1172 } 1170 1173 1171 - res = of_register_platform_driver(&mpc85xx_mc_err_driver); 1174 + res = platform_driver_register(&mpc85xx_mc_err_driver); 1172 1175 if (res) 1173 1176 printk(KERN_WARNING EDAC_MOD_STR "MC fails to register\n"); 1174 1177 1175 - res = of_register_platform_driver(&mpc85xx_l2_err_driver); 1178 + res = platform_driver_register(&mpc85xx_l2_err_driver); 1176 1179 if (res) 1177 1180 printk(KERN_WARNING EDAC_MOD_STR "L2 fails to register\n"); 1178 1181 1179 1182 #ifdef CONFIG_PCI 1180 - res = of_register_platform_driver(&mpc85xx_pci_err_driver); 1183 + res = platform_driver_register(&mpc85xx_pci_err_driver); 1181 1184 if (res) 1182 1185 printk(KERN_WARNING EDAC_MOD_STR "PCI fails to register\n"); 1183 1186 #endif ··· 1209 1212 on_each_cpu(mpc85xx_mc_restore_hid1, NULL, 0); 1210 1213 #endif 1211 1214 #ifdef CONFIG_PCI 1212 - of_unregister_platform_driver(&mpc85xx_pci_err_driver); 1215 + platform_driver_unregister(&mpc85xx_pci_err_driver); 1213 1216 #endif 1214 - of_unregister_platform_driver(&mpc85xx_l2_err_driver); 1215 - of_unregister_platform_driver(&mpc85xx_mc_err_driver); 1217 + platform_driver_unregister(&mpc85xx_l2_err_driver); 1218 + platform_driver_unregister(&mpc85xx_mc_err_driver); 1216 1219 } 1217 1220 1218 1221 module_exit(mpc85xx_mc_exit);
+7 -16
drivers/edac/ppc4xx_edac.c
··· 184 184 185 185 /* Function Prototypes */ 186 186 187 - static int ppc4xx_edac_probe(struct platform_device *device, 188 - const struct of_device_id *device_id); 187 + static int ppc4xx_edac_probe(struct platform_device *device) 189 188 static int ppc4xx_edac_remove(struct platform_device *device); 190 189 191 190 /* Global Variables */ ··· 200 201 { } 201 202 }; 202 203 203 - static struct of_platform_driver ppc4xx_edac_driver = { 204 + static struct platform_driver ppc4xx_edac_driver = { 204 205 .probe = ppc4xx_edac_probe, 205 206 .remove = ppc4xx_edac_remove, 206 207 .driver = { ··· 996 997 * initialized. 997 998 * @op: A pointer to the OpenFirmware device tree node associated 998 999 * with the controller this EDAC instance is bound to. 999 - * @match: A pointer to the OpenFirmware device tree match 1000 - * information associated with the controller this EDAC instance 1001 - * is bound to. 1002 1000 * @dcr_host: A pointer to the DCR data containing the DCR mapping 1003 1001 * for this controller instance. 1004 1002 * @mcopt1: The 32-bit Memory Controller Option 1 register value ··· 1011 1015 static int __devinit 1012 1016 ppc4xx_edac_mc_init(struct mem_ctl_info *mci, 1013 1017 struct platform_device *op, 1014 - const struct of_device_id *match, 1015 1018 const dcr_host_t *dcr_host, 1016 1019 u32 mcopt1) 1017 1020 { ··· 1019 1024 struct ppc4xx_edac_pdata *pdata = NULL; 1020 1025 const struct device_node *np = op->dev.of_node; 1021 1026 1022 - if (match == NULL) 1027 + if (op->dev.of_match == NULL) 1023 1028 return -EINVAL; 1024 1029 1025 1030 /* Initial driver pointers and private data */ ··· 1222 1227 * ppc4xx_edac_probe - check controller and bind driver 1223 1228 * @op: A pointer to the OpenFirmware device tree node associated 1224 1229 * with the controller being probed for driver binding. 1225 - * @match: A pointer to the OpenFirmware device tree match 1226 - * information associated with the controller being probed 1227 - * for driver binding. 1228 1230 * 1229 1231 * This routine probes a specific ibm,sdram-4xx-ddr2 controller 1230 1232 * instance for binding with the driver. ··· 1229 1237 * Returns 0 if the controller instance was successfully bound to the 1230 1238 * driver; otherwise, < 0 on error. 1231 1239 */ 1232 - static int __devinit 1233 - ppc4xx_edac_probe(struct platform_device *op, const struct of_device_id *match) 1240 + static int __devinit ppc4xx_edac_probe(struct platform_device *op) 1234 1241 { 1235 1242 int status = 0; 1236 1243 u32 mcopt1, memcheck; ··· 1295 1304 goto done; 1296 1305 } 1297 1306 1298 - status = ppc4xx_edac_mc_init(mci, op, match, &dcr_host, mcopt1); 1307 + status = ppc4xx_edac_mc_init(mci, op, &dcr_host, mcopt1); 1299 1308 1300 1309 if (status) { 1301 1310 ppc4xx_edac_mc_printk(KERN_ERR, mci, ··· 1412 1421 1413 1422 ppc4xx_edac_opstate_init(); 1414 1423 1415 - return of_register_platform_driver(&ppc4xx_edac_driver); 1424 + return platform_driver_register(&ppc4xx_edac_driver); 1416 1425 } 1417 1426 1418 1427 /** ··· 1425 1434 static void __exit 1426 1435 ppc4xx_edac_exit(void) 1427 1436 { 1428 - of_unregister_platform_driver(&ppc4xx_edac_driver); 1437 + platform_driver_unregister(&ppc4xx_edac_driver); 1429 1438 } 1430 1439 1431 1440 module_init(ppc4xx_edac_init);
+3 -4
drivers/macintosh/smu.c
··· 645 645 646 646 static DECLARE_WORK(smu_expose_childs_work, smu_expose_childs); 647 647 648 - static int smu_platform_probe(struct platform_device* dev, 649 - const struct of_device_id *match) 648 + static int smu_platform_probe(struct platform_device* dev) 650 649 { 651 650 if (!smu) 652 651 return -ENODEV; ··· 668 669 {}, 669 670 }; 670 671 671 - static struct of_platform_driver smu_of_platform_driver = 672 + static struct platform_driver smu_of_platform_driver = 672 673 { 673 674 .driver = { 674 675 .name = "smu", ··· 688 689 * I'm a bit too far from figuring out how that works with those 689 690 * new chipsets, but that will come back and bite us 690 691 */ 691 - of_register_platform_driver(&smu_of_platform_driver); 692 + platform_driver_register(&smu_of_platform_driver); 692 693 return 0; 693 694 } 694 695
+4 -4
drivers/macintosh/therm_pm72.c
··· 2210 2210 } 2211 2211 } 2212 2212 2213 - static int fcu_of_probe(struct platform_device* dev, const struct of_device_id *match) 2213 + static int fcu_of_probe(struct platform_device* dev) 2214 2214 { 2215 2215 state = state_detached; 2216 2216 of_dev = dev; ··· 2240 2240 }; 2241 2241 MODULE_DEVICE_TABLE(of, fcu_match); 2242 2242 2243 - static struct of_platform_driver fcu_of_platform_driver = 2243 + static struct platform_driver fcu_of_platform_driver = 2244 2244 { 2245 2245 .driver = { 2246 2246 .name = "temperature", ··· 2263 2263 !rackmac) 2264 2264 return -ENODEV; 2265 2265 2266 - return of_register_platform_driver(&fcu_of_platform_driver); 2266 + return platform_driver_register(&fcu_of_platform_driver); 2267 2267 } 2268 2268 2269 2269 static void __exit therm_pm72_exit(void) 2270 2270 { 2271 - of_unregister_platform_driver(&fcu_of_platform_driver); 2271 + platform_driver_unregister(&fcu_of_platform_driver); 2272 2272 } 2273 2273 2274 2274 module_init(therm_pm72_init);
+4 -5
drivers/macintosh/therm_windtunnel.c
··· 443 443 /* initialization / cleanup */ 444 444 /************************************************************************/ 445 445 446 - static int 447 - therm_of_probe( struct platform_device *dev, const struct of_device_id *match ) 446 + static int therm_of_probe(struct platform_device *dev) 448 447 { 449 448 return i2c_add_driver( &g4fan_driver ); 450 449 } ··· 461 462 }, {} 462 463 }; 463 464 464 - static struct of_platform_driver therm_of_driver = { 465 + static struct platform_driver therm_of_driver = { 465 466 .driver = { 466 467 .name = "temperature", 467 468 .owner = THIS_MODULE, ··· 508 509 return -ENODEV; 509 510 } 510 511 511 - of_register_platform_driver( &therm_of_driver ); 512 + platform_driver_register( &therm_of_driver ); 512 513 return 0; 513 514 } 514 515 515 516 static void __exit 516 517 g4fan_exit( void ) 517 518 { 518 - of_unregister_platform_driver( &therm_of_driver ); 519 + platform_driver_unregister( &therm_of_driver ); 519 520 520 521 if( x.of_dev ) 521 522 of_device_unregister( x.of_dev );