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

dt: Eliminate of_platform_{,un}register_driver

Final step to eliminate of_platform_bus_type. They're all just
platform drivers now.

v2: fix type in pasemi_nand.c (thanks to Stephen Rothwell)

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

+134 -148
+4 -4
drivers/ata/pata_mpc52xx.c
··· 680 680 /* ======================================================================== */ 681 681 682 682 static int __devinit 683 - mpc52xx_ata_probe(struct platform_device *op, const struct of_device_id *match) 683 + mpc52xx_ata_probe(struct platform_device *op) 684 684 { 685 685 unsigned int ipb_freq; 686 686 struct resource res_mem; ··· 883 883 }; 884 884 885 885 886 - static struct of_platform_driver mpc52xx_ata_of_platform_driver = { 886 + static struct platform_driver mpc52xx_ata_of_platform_driver = { 887 887 .probe = mpc52xx_ata_probe, 888 888 .remove = mpc52xx_ata_remove, 889 889 #ifdef CONFIG_PM ··· 906 906 mpc52xx_ata_init(void) 907 907 { 908 908 printk(KERN_INFO "ata: MPC52xx IDE/ATA libata driver\n"); 909 - return of_register_platform_driver(&mpc52xx_ata_of_platform_driver); 909 + return platform_driver_register(&mpc52xx_ata_of_platform_driver); 910 910 } 911 911 912 912 static void __exit 913 913 mpc52xx_ata_exit(void) 914 914 { 915 - of_unregister_platform_driver(&mpc52xx_ata_of_platform_driver); 915 + platform_driver_unregister(&mpc52xx_ata_of_platform_driver); 916 916 } 917 917 918 918 module_init(mpc52xx_ata_init);
+4 -5
drivers/ata/pata_of_platform.c
··· 14 14 #include <linux/of_platform.h> 15 15 #include <linux/ata_platform.h> 16 16 17 - static int __devinit pata_of_platform_probe(struct platform_device *ofdev, 18 - const struct of_device_id *match) 17 + static int __devinit pata_of_platform_probe(struct platform_device *ofdev) 19 18 { 20 19 int ret; 21 20 struct device_node *dn = ofdev->dev.of_node; ··· 89 90 }; 90 91 MODULE_DEVICE_TABLE(of, pata_of_platform_match); 91 92 92 - static struct of_platform_driver pata_of_platform_driver = { 93 + static struct platform_driver pata_of_platform_driver = { 93 94 .driver = { 94 95 .name = "pata_of_platform", 95 96 .owner = THIS_MODULE, ··· 101 102 102 103 static int __init pata_of_platform_init(void) 103 104 { 104 - return of_register_platform_driver(&pata_of_platform_driver); 105 + return platform_driver_register(&pata_of_platform_driver); 105 106 } 106 107 module_init(pata_of_platform_init); 107 108 108 109 static void __exit pata_of_platform_exit(void) 109 110 { 110 - of_unregister_platform_driver(&pata_of_platform_driver); 111 + platform_driver_unregister(&pata_of_platform_driver); 111 112 } 112 113 module_exit(pata_of_platform_exit); 113 114
+4 -5
drivers/ata/sata_dwc_460ex.c
··· 1588 1588 }, 1589 1589 }; 1590 1590 1591 - static int sata_dwc_probe(struct platform_device *ofdev, 1592 - const struct of_device_id *match) 1591 + static int sata_dwc_probe(struct platform_device *ofdev) 1593 1592 { 1594 1593 struct sata_dwc_device *hsdev; 1595 1594 u32 idr, versionr; ··· 1726 1727 }; 1727 1728 MODULE_DEVICE_TABLE(of, sata_dwc_match); 1728 1729 1729 - static struct of_platform_driver sata_dwc_driver = { 1730 + static struct platform_driver sata_dwc_driver = { 1730 1731 .driver = { 1731 1732 .name = DRV_NAME, 1732 1733 .owner = THIS_MODULE, ··· 1738 1739 1739 1740 static int __init sata_dwc_init(void) 1740 1741 { 1741 - return of_register_platform_driver(&sata_dwc_driver); 1742 + return platform_driver_register(&sata_dwc_driver); 1742 1743 } 1743 1744 1744 1745 static void __exit sata_dwc_exit(void) 1745 1746 { 1746 - of_unregister_platform_driver(&sata_dwc_driver); 1747 + platform_driver_unregister(&sata_dwc_driver); 1747 1748 } 1748 1749 1749 1750 module_init(sata_dwc_init);
+4 -5
drivers/ata/sata_fsl.c
··· 1293 1293 }, 1294 1294 }; 1295 1295 1296 - static int sata_fsl_probe(struct platform_device *ofdev, 1297 - const struct of_device_id *match) 1296 + static int sata_fsl_probe(struct platform_device *ofdev) 1298 1297 { 1299 1298 int retval = -ENXIO; 1300 1299 void __iomem *hcr_base = NULL; ··· 1422 1423 1423 1424 MODULE_DEVICE_TABLE(of, fsl_sata_match); 1424 1425 1425 - static struct of_platform_driver fsl_sata_driver = { 1426 + static struct platform_driver fsl_sata_driver = { 1426 1427 .driver = { 1427 1428 .name = "fsl-sata", 1428 1429 .owner = THIS_MODULE, ··· 1438 1439 1439 1440 static int __init sata_fsl_init(void) 1440 1441 { 1441 - of_register_platform_driver(&fsl_sata_driver); 1442 + platform_driver_register(&fsl_sata_driver); 1442 1443 return 0; 1443 1444 } 1444 1445 1445 1446 static void __exit sata_fsl_exit(void) 1446 1447 { 1447 - of_unregister_platform_driver(&fsl_sata_driver); 1448 + platform_driver_unregister(&fsl_sata_driver); 1448 1449 } 1449 1450 1450 1451 MODULE_LICENSE("GPL");
+10 -7
drivers/atm/fore200e.c
··· 2643 2643 } 2644 2644 2645 2645 #ifdef CONFIG_SBUS 2646 - static int __devinit fore200e_sba_probe(struct platform_device *op, 2647 - const struct of_device_id *match) 2646 + static int __devinit fore200e_sba_probe(struct platform_device *op) 2648 2647 { 2649 - const struct fore200e_bus *bus = match->data; 2648 + const struct fore200e_bus *bus; 2650 2649 struct fore200e *fore200e; 2651 2650 static int index = 0; 2652 2651 int err; 2652 + 2653 + if (!op->dev.of_match) 2654 + return -EINVAL; 2655 + bus = op->dev.of_match->data; 2653 2656 2654 2657 fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL); 2655 2658 if (!fore200e) ··· 2697 2694 }; 2698 2695 MODULE_DEVICE_TABLE(of, fore200e_sba_match); 2699 2696 2700 - static struct of_platform_driver fore200e_sba_driver = { 2697 + static struct platform_driver fore200e_sba_driver = { 2701 2698 .driver = { 2702 2699 .name = "fore_200e", 2703 2700 .owner = THIS_MODULE, ··· 2798 2795 printk(FORE200E "FORE Systems 200E-series ATM driver - version " FORE200E_VERSION "\n"); 2799 2796 2800 2797 #ifdef CONFIG_SBUS 2801 - err = of_register_platform_driver(&fore200e_sba_driver); 2798 + err = platform_driver_register(&fore200e_sba_driver); 2802 2799 if (err) 2803 2800 return err; 2804 2801 #endif ··· 2809 2806 2810 2807 #ifdef CONFIG_SBUS 2811 2808 if (err) 2812 - of_unregister_platform_driver(&fore200e_sba_driver); 2809 + platform_driver_unregister(&fore200e_sba_driver); 2813 2810 #endif 2814 2811 2815 2812 return err; ··· 2821 2818 pci_unregister_driver(&fore200e_pca_driver); 2822 2819 #endif 2823 2820 #ifdef CONFIG_SBUS 2824 - of_unregister_platform_driver(&fore200e_sba_driver); 2821 + platform_driver_unregister(&fore200e_sba_driver); 2825 2822 #endif 2826 2823 } 2827 2824
+4 -7
drivers/block/xsysace.c
··· 1195 1195 */ 1196 1196 1197 1197 #if defined(CONFIG_OF) 1198 - static int __devinit 1199 - ace_of_probe(struct platform_device *op, const struct of_device_id *match) 1198 + static int __devinit ace_of_probe(struct platform_device *op) 1200 1199 { 1201 1200 struct resource res; 1202 1201 resource_size_t physaddr; 1203 1202 const u32 *id; 1204 1203 int irq, bus_width, rc; 1205 - 1206 - dev_dbg(&op->dev, "ace_of_probe(%p, %p)\n", op, match); 1207 1204 1208 1205 /* device id */ 1209 1206 id = of_get_property(op->dev.of_node, "port-number", NULL); ··· 1242 1245 }; 1243 1246 MODULE_DEVICE_TABLE(of, ace_of_match); 1244 1247 1245 - static struct of_platform_driver ace_of_driver = { 1248 + static struct platform_driver ace_of_driver = { 1246 1249 .probe = ace_of_probe, 1247 1250 .remove = __devexit_p(ace_of_remove), 1248 1251 .driver = { ··· 1256 1259 static inline int __init ace_of_register(void) 1257 1260 { 1258 1261 pr_debug("xsysace: registering OF binding\n"); 1259 - return of_register_platform_driver(&ace_of_driver); 1262 + return platform_driver_register(&ace_of_driver); 1260 1263 } 1261 1264 1262 1265 static inline void __exit ace_of_unregister(void) 1263 1266 { 1264 - of_unregister_platform_driver(&ace_of_driver); 1267 + platform_driver_unregister(&ace_of_driver); 1265 1268 } 1266 1269 #else /* CONFIG_OF */ 1267 1270 /* CONFIG_OF not enabled; do nothing helpers */
+4 -5
drivers/crypto/talitos.c
··· 2402 2402 return t_alg; 2403 2403 } 2404 2404 2405 - static int talitos_probe(struct platform_device *ofdev, 2406 - const struct of_device_id *match) 2405 + static int talitos_probe(struct platform_device *ofdev) 2407 2406 { 2408 2407 struct device *dev = &ofdev->dev; 2409 2408 struct device_node *np = ofdev->dev.of_node; ··· 2579 2580 }; 2580 2581 MODULE_DEVICE_TABLE(of, talitos_match); 2581 2582 2582 - static struct of_platform_driver talitos_driver = { 2583 + static struct platform_driver talitos_driver = { 2583 2584 .driver = { 2584 2585 .name = "talitos", 2585 2586 .owner = THIS_MODULE, ··· 2591 2592 2592 2593 static int __init talitos_init(void) 2593 2594 { 2594 - return of_register_platform_driver(&talitos_driver); 2595 + return platform_driver_register(&talitos_driver); 2595 2596 } 2596 2597 module_init(talitos_init); 2597 2598 2598 2599 static void __exit talitos_exit(void) 2599 2600 { 2600 - of_unregister_platform_driver(&talitos_driver); 2601 + platform_driver_unregister(&talitos_driver); 2601 2602 } 2602 2603 module_exit(talitos_exit); 2603 2604
+4 -5
drivers/i2c/busses/i2c-cpm.c
··· 634 634 cpm_muram_free(cpm->i2c_addr); 635 635 } 636 636 637 - static int __devinit cpm_i2c_probe(struct platform_device *ofdev, 638 - const struct of_device_id *match) 637 + static int __devinit cpm_i2c_probe(struct platform_device *ofdev) 639 638 { 640 639 int result, len; 641 640 struct cpm_i2c *cpm; ··· 717 718 718 719 MODULE_DEVICE_TABLE(of, cpm_i2c_match); 719 720 720 - static struct of_platform_driver cpm_i2c_driver = { 721 + static struct platform_driver cpm_i2c_driver = { 721 722 .probe = cpm_i2c_probe, 722 723 .remove = __devexit_p(cpm_i2c_remove), 723 724 .driver = { ··· 729 730 730 731 static int __init cpm_i2c_init(void) 731 732 { 732 - return of_register_platform_driver(&cpm_i2c_driver); 733 + return platform_driver_register(&cpm_i2c_driver); 733 734 } 734 735 735 736 static void __exit cpm_i2c_exit(void) 736 737 { 737 - of_unregister_platform_driver(&cpm_i2c_driver); 738 + platform_driver_unregister(&cpm_i2c_driver); 738 739 } 739 740 740 741 module_init(cpm_i2c_init);
+4 -5
drivers/i2c/busses/i2c-ibm_iic.c
··· 691 691 /* 692 692 * Register single IIC interface 693 693 */ 694 - static int __devinit iic_probe(struct platform_device *ofdev, 695 - const struct of_device_id *match) 694 + static int __devinit iic_probe(struct platform_device *ofdev) 696 695 { 697 696 struct device_node *np = ofdev->dev.of_node; 698 697 struct ibm_iic_private *dev; ··· 805 806 {} 806 807 }; 807 808 808 - static struct of_platform_driver ibm_iic_driver = { 809 + static struct platform_driver ibm_iic_driver = { 809 810 .driver = { 810 811 .name = "ibm-iic", 811 812 .owner = THIS_MODULE, ··· 817 818 818 819 static int __init iic_init(void) 819 820 { 820 - return of_register_platform_driver(&ibm_iic_driver); 821 + return platform_driver_register(&ibm_iic_driver); 821 822 } 822 823 823 824 static void __exit iic_exit(void) 824 825 { 825 - of_unregister_platform_driver(&ibm_iic_driver); 826 + platform_driver_unregister(&ibm_iic_driver); 826 827 } 827 828 828 829 module_init(iic_init);
+9 -13
drivers/i2c/busses/i2c-mpc.c
··· 560 560 .timeout = HZ, 561 561 }; 562 562 563 - static int __devinit fsl_i2c_probe(struct platform_device *op, 564 - const struct of_device_id *match) 563 + static int __devinit fsl_i2c_probe(struct platform_device *op) 565 564 { 566 565 struct mpc_i2c *i2c; 567 566 const u32 *prop; 568 567 u32 clock = MPC_I2C_CLOCK_LEGACY; 569 568 int result = 0; 570 569 int plen; 570 + 571 + if (!op->dev.of_match) 572 + return -EINVAL; 571 573 572 574 i2c = kzalloc(sizeof(*i2c), GFP_KERNEL); 573 575 if (!i2c) ··· 605 603 clock = *prop; 606 604 } 607 605 608 - if (match->data) { 609 - struct mpc_i2c_data *data = match->data; 606 + if (op->dev.of_match->data) { 607 + struct mpc_i2c_data *data = op->dev.of_match->data; 610 608 data->setup(op->dev.of_node, i2c, clock, data->prescaler); 611 609 } else { 612 610 /* Backwards compatibility */ ··· 702 700 MODULE_DEVICE_TABLE(of, mpc_i2c_of_match); 703 701 704 702 /* Structure for a device driver */ 705 - static struct of_platform_driver mpc_i2c_driver = { 703 + static struct platform_driver mpc_i2c_driver = { 706 704 .probe = fsl_i2c_probe, 707 705 .remove = __devexit_p(fsl_i2c_remove), 708 706 .driver = { ··· 714 712 715 713 static int __init fsl_i2c_init(void) 716 714 { 717 - int rv; 718 - 719 - rv = of_register_platform_driver(&mpc_i2c_driver); 720 - if (rv) 721 - printk(KERN_ERR DRV_NAME 722 - " of_register_platform_driver failed (%i)\n", rv); 723 - return rv; 715 + return platform_driver_register(&mpc_i2c_driver); 724 716 } 725 717 726 718 static void __exit fsl_i2c_exit(void) 727 719 { 728 - of_unregister_platform_driver(&mpc_i2c_driver); 720 + platform_driver_unregister(&mpc_i2c_driver); 729 721 } 730 722 731 723 module_init(fsl_i2c_init);
+4 -5
drivers/input/serio/xilinx_ps2.c
··· 232 232 * It returns 0, if the driver is bound to the PS/2 device, or a negative 233 233 * value if there is an error. 234 234 */ 235 - static int __devinit xps2_of_probe(struct platform_device *ofdev, 236 - const struct of_device_id *match) 235 + static int __devinit xps2_of_probe(struct platform_device *ofdev) 237 236 { 238 237 struct resource r_irq; /* Interrupt resources */ 239 238 struct resource r_mem; /* IO mem resources */ ··· 360 361 }; 361 362 MODULE_DEVICE_TABLE(of, xps2_of_match); 362 363 363 - static struct of_platform_driver xps2_of_driver = { 364 + static struct platform_driver xps2_of_driver = { 364 365 .driver = { 365 366 .name = DRIVER_NAME, 366 367 .owner = THIS_MODULE, ··· 372 373 373 374 static int __init xps2_init(void) 374 375 { 375 - return of_register_platform_driver(&xps2_of_driver); 376 + return platform_driver_register(&xps2_of_driver); 376 377 } 377 378 378 379 static void __exit xps2_cleanup(void) 379 380 { 380 - of_unregister_platform_driver(&xps2_of_driver); 381 + platform_driver_unregister(&xps2_of_driver); 381 382 } 382 383 383 384 module_init(xps2_init);
+4 -5
drivers/media/video/fsl-viu.c
··· 1445 1445 .current_norm = V4L2_STD_NTSC_M, 1446 1446 }; 1447 1447 1448 - static int __devinit viu_of_probe(struct platform_device *op, 1449 - const struct of_device_id *match) 1448 + static int __devinit viu_of_probe(struct platform_device *op) 1450 1449 { 1451 1450 struct viu_dev *viu_dev; 1452 1451 struct video_device *vdev; ··· 1626 1627 }; 1627 1628 MODULE_DEVICE_TABLE(of, mpc512x_viu_of_match); 1628 1629 1629 - static struct of_platform_driver viu_of_platform_driver = { 1630 + static struct platform_driver viu_of_platform_driver = { 1630 1631 .probe = viu_of_probe, 1631 1632 .remove = __devexit_p(viu_of_remove), 1632 1633 #ifdef CONFIG_PM ··· 1642 1643 1643 1644 static int __init viu_init(void) 1644 1645 { 1645 - return of_register_platform_driver(&viu_of_platform_driver); 1646 + return platform_driver_register(&viu_of_platform_driver); 1646 1647 } 1647 1648 1648 1649 static void __exit viu_exit(void) 1649 1650 { 1650 - of_unregister_platform_driver(&viu_of_platform_driver); 1651 + platform_driver_unregister(&viu_of_platform_driver); 1651 1652 } 1652 1653 1653 1654 module_init(viu_init);
+9 -6
drivers/mmc/host/sdhci-of-core.c
··· 124 124 #endif 125 125 } 126 126 127 - static int __devinit sdhci_of_probe(struct platform_device *ofdev, 128 - const struct of_device_id *match) 127 + static int __devinit sdhci_of_probe(struct platform_device *ofdev) 129 128 { 130 129 struct device_node *np = ofdev->dev.of_node; 131 - struct sdhci_of_data *sdhci_of_data = match->data; 130 + struct sdhci_of_data *sdhci_of_data; 132 131 struct sdhci_host *host; 133 132 struct sdhci_of_host *of_host; 134 133 const __be32 *clk; 135 134 int size; 136 135 int ret; 136 + 137 + if (!ofdev->dev.of_match) 138 + return -EINVAL; 139 + sdhci_of_data = ofdev->dev.of_match->data; 137 140 138 141 if (!of_device_is_available(np)) 139 142 return -ENODEV; ··· 220 217 }; 221 218 MODULE_DEVICE_TABLE(of, sdhci_of_match); 222 219 223 - static struct of_platform_driver sdhci_of_driver = { 220 + static struct platform_driver sdhci_of_driver = { 224 221 .driver = { 225 222 .name = "sdhci-of", 226 223 .owner = THIS_MODULE, ··· 234 231 235 232 static int __init sdhci_of_init(void) 236 233 { 237 - return of_register_platform_driver(&sdhci_of_driver); 234 + return platform_driver_register(&sdhci_of_driver); 238 235 } 239 236 module_init(sdhci_of_init); 240 237 241 238 static void __exit sdhci_of_exit(void) 242 239 { 243 - of_unregister_platform_driver(&sdhci_of_driver); 240 + platform_driver_unregister(&sdhci_of_driver); 244 241 } 245 242 module_exit(sdhci_of_exit); 246 243
+9 -6
drivers/mtd/maps/physmap_of.c
··· 216 216 } 217 217 #endif 218 218 219 - static int __devinit of_flash_probe(struct platform_device *dev, 220 - const struct of_device_id *match) 219 + static int __devinit of_flash_probe(struct platform_device *dev) 221 220 { 222 221 #ifdef CONFIG_MTD_PARTITIONS 223 222 const char **part_probe_types; ··· 224 225 struct device_node *dp = dev->dev.of_node; 225 226 struct resource res; 226 227 struct of_flash *info; 227 - const char *probe_type = match->data; 228 + const char *probe_type; 228 229 const __be32 *width; 229 230 int err; 230 231 int i; ··· 233 234 int reg_tuple_size; 234 235 struct mtd_info **mtd_list = NULL; 235 236 resource_size_t res_size; 237 + 238 + if (!dev->dev.of_match) 239 + return -EINVAL; 240 + probe_type = dev->dev.of_match->data; 236 241 237 242 reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32); 238 243 ··· 421 418 }; 422 419 MODULE_DEVICE_TABLE(of, of_flash_match); 423 420 424 - static struct of_platform_driver of_flash_driver = { 421 + static struct platform_driver of_flash_driver = { 425 422 .driver = { 426 423 .name = "of-flash", 427 424 .owner = THIS_MODULE, ··· 433 430 434 431 static int __init of_flash_init(void) 435 432 { 436 - return of_register_platform_driver(&of_flash_driver); 433 + return platform_driver_register(&of_flash_driver); 437 434 } 438 435 439 436 static void __exit of_flash_exit(void) 440 437 { 441 - of_unregister_platform_driver(&of_flash_driver); 438 + platform_driver_unregister(&of_flash_driver); 442 439 } 443 440 444 441 module_init(of_flash_init);
+4 -4
drivers/mtd/maps/sun_uflash.c
··· 108 108 return 0; 109 109 } 110 110 111 - static int __devinit uflash_probe(struct platform_device *op, const struct of_device_id *match) 111 + static int __devinit uflash_probe(struct platform_device *op) 112 112 { 113 113 struct device_node *dp = op->dev.of_node; 114 114 ··· 148 148 149 149 MODULE_DEVICE_TABLE(of, uflash_match); 150 150 151 - static struct of_platform_driver uflash_driver = { 151 + static struct platform_driver uflash_driver = { 152 152 .driver = { 153 153 .name = DRIVER_NAME, 154 154 .owner = THIS_MODULE, ··· 160 160 161 161 static int __init uflash_init(void) 162 162 { 163 - return of_register_platform_driver(&uflash_driver); 163 + return platform_driver_register(&uflash_driver); 164 164 } 165 165 166 166 static void __exit uflash_exit(void) 167 167 { 168 - of_unregister_platform_driver(&uflash_driver); 168 + platform_driver_unregister(&uflash_driver); 169 169 } 170 170 171 171 module_init(uflash_init);
+4 -5
drivers/mtd/nand/fsl_upm.c
··· 217 217 return ret; 218 218 } 219 219 220 - static int __devinit fun_probe(struct platform_device *ofdev, 221 - const struct of_device_id *ofid) 220 + static int __devinit fun_probe(struct platform_device *ofdev) 222 221 { 223 222 struct fsl_upm_nand *fun; 224 223 struct resource io_res; ··· 359 360 }; 360 361 MODULE_DEVICE_TABLE(of, of_fun_match); 361 362 362 - static struct of_platform_driver of_fun_driver = { 363 + static struct platform_driver of_fun_driver = { 363 364 .driver = { 364 365 .name = "fsl,upm-nand", 365 366 .owner = THIS_MODULE, ··· 371 372 372 373 static int __init fun_module_init(void) 373 374 { 374 - return of_register_platform_driver(&of_fun_driver); 375 + return platform_driver_register(&of_fun_driver); 375 376 } 376 377 module_init(fun_module_init); 377 378 378 379 static void __exit fun_module_exit(void) 379 380 { 380 - of_unregister_platform_driver(&of_fun_driver); 381 + platform_driver_unregister(&of_fun_driver); 381 382 } 382 383 module_exit(fun_module_exit); 383 384
+4 -5
drivers/mtd/nand/mpc5121_nfc.c
··· 650 650 iounmap(prv->csreg); 651 651 } 652 652 653 - static int __devinit mpc5121_nfc_probe(struct platform_device *op, 654 - const struct of_device_id *match) 653 + static int __devinit mpc5121_nfc_probe(struct platform_device *op) 655 654 { 656 655 struct device_node *rootnode, *dn = op->dev.of_node; 657 656 struct device *dev = &op->dev; ··· 890 891 {}, 891 892 }; 892 893 893 - static struct of_platform_driver mpc5121_nfc_driver = { 894 + static struct platform_driver mpc5121_nfc_driver = { 894 895 .probe = mpc5121_nfc_probe, 895 896 .remove = __devexit_p(mpc5121_nfc_remove), 896 897 .driver = { ··· 902 903 903 904 static int __init mpc5121_nfc_init(void) 904 905 { 905 - return of_register_platform_driver(&mpc5121_nfc_driver); 906 + return platform_driver_register(&mpc5121_nfc_driver); 906 907 } 907 908 908 909 module_init(mpc5121_nfc_init); 909 910 910 911 static void __exit mpc5121_nfc_cleanup(void) 911 912 { 912 - of_unregister_platform_driver(&mpc5121_nfc_driver); 913 + platform_driver_unregister(&mpc5121_nfc_driver); 913 914 } 914 915 915 916 module_exit(mpc5121_nfc_cleanup);
+4 -5
drivers/mtd/nand/ndfc.c
··· 225 225 return ret; 226 226 } 227 227 228 - static int __devinit ndfc_probe(struct platform_device *ofdev, 229 - const struct of_device_id *match) 228 + static int __devinit ndfc_probe(struct platform_device *ofdev) 230 229 { 231 230 struct ndfc_controller *ndfc = &ndfc_ctrl; 232 231 const __be32 *reg; ··· 291 292 }; 292 293 MODULE_DEVICE_TABLE(of, ndfc_match); 293 294 294 - static struct of_platform_driver ndfc_driver = { 295 + static struct platform_driver ndfc_driver = { 295 296 .driver = { 296 297 .name = "ndfc", 297 298 .owner = THIS_MODULE, ··· 303 304 304 305 static int __init ndfc_nand_init(void) 305 306 { 306 - return of_register_platform_driver(&ndfc_driver); 307 + return platform_driver_register(&ndfc_driver); 307 308 } 308 309 309 310 static void __exit ndfc_nand_exit(void) 310 311 { 311 - of_unregister_platform_driver(&ndfc_driver); 312 + platform_driver_unregister(&ndfc_driver); 312 313 } 313 314 314 315 module_init(ndfc_nand_init);
+4 -5
drivers/mtd/nand/pasemi_nand.c
··· 89 89 return !!(inl(lpcctl) & LBICTRL_LPCCTL_NR); 90 90 } 91 91 92 - static int __devinit pasemi_nand_probe(struct platform_device *ofdev, 93 - const struct of_device_id *match) 92 + static int __devinit pasemi_nand_probe(struct platform_device *ofdev) 94 93 { 95 94 struct pci_dev *pdev; 96 95 struct device_node *np = ofdev->dev.of_node; ··· 218 219 219 220 MODULE_DEVICE_TABLE(of, pasemi_nand_match); 220 221 221 - static struct of_platform_driver pasemi_nand_driver = 222 + static struct platform_driver pasemi_nand_driver = 222 223 { 223 224 .driver = { 224 225 .name = (char*)driver_name, ··· 231 232 232 233 static int __init pasemi_nand_init(void) 233 234 { 234 - return of_register_platform_driver(&pasemi_nand_driver); 235 + return platform_driver_register(&pasemi_nand_driver); 235 236 } 236 237 module_init(pasemi_nand_init); 237 238 238 239 static void __exit pasemi_nand_exit(void) 239 240 { 240 - of_unregister_platform_driver(&pasemi_nand_driver); 241 + platform_driver_unregister(&pasemi_nand_driver); 241 242 } 242 243 module_exit(pasemi_nand_exit); 243 244
+4 -5
drivers/mtd/nand/socrates_nand.c
··· 162 162 /* 163 163 * Probe for the NAND device. 164 164 */ 165 - static int __devinit socrates_nand_probe(struct platform_device *ofdev, 166 - const struct of_device_id *ofid) 165 + static int __devinit socrates_nand_probe(struct platform_device *ofdev) 167 166 { 168 167 struct socrates_nand_host *host; 169 168 struct mtd_info *mtd; ··· 299 300 300 301 MODULE_DEVICE_TABLE(of, socrates_nand_match); 301 302 302 - static struct of_platform_driver socrates_nand_driver = { 303 + static struct platform_driver socrates_nand_driver = { 303 304 .driver = { 304 305 .name = "socrates_nand", 305 306 .owner = THIS_MODULE, ··· 311 312 312 313 static int __init socrates_nand_init(void) 313 314 { 314 - return of_register_platform_driver(&socrates_nand_driver); 315 + return platform_driver_register(&socrates_nand_driver); 315 316 } 316 317 317 318 static void __exit socrates_nand_exit(void) 318 319 { 319 - of_unregister_platform_driver(&socrates_nand_driver); 320 + platform_driver_unregister(&socrates_nand_driver); 320 321 } 321 322 322 323 module_init(socrates_nand_init);
+4 -5
drivers/pcmcia/electra_cf.c
··· 181 181 .set_mem_map = electra_cf_set_mem_map, 182 182 }; 183 183 184 - static int __devinit electra_cf_probe(struct platform_device *ofdev, 185 - const struct of_device_id *match) 184 + static int __devinit electra_cf_probe(struct platform_device *ofdev) 186 185 { 187 186 struct device *device = &ofdev->dev; 188 187 struct device_node *np = ofdev->dev.of_node; ··· 355 356 }; 356 357 MODULE_DEVICE_TABLE(of, electra_cf_match); 357 358 358 - static struct of_platform_driver electra_cf_driver = { 359 + static struct platform_driver electra_cf_driver = { 359 360 .driver = { 360 361 .name = (char *)driver_name, 361 362 .owner = THIS_MODULE, ··· 367 368 368 369 static int __init electra_cf_init(void) 369 370 { 370 - return of_register_platform_driver(&electra_cf_driver); 371 + return platform_driver_register(&electra_cf_driver); 371 372 } 372 373 module_init(electra_cf_init); 373 374 374 375 static void __exit electra_cf_exit(void) 375 376 { 376 - of_unregister_platform_driver(&electra_cf_driver); 377 + platform_driver_unregister(&electra_cf_driver); 377 378 } 378 379 module_exit(electra_cf_exit); 379 380
+4 -5
drivers/pcmcia/m8xx_pcmcia.c
··· 1148 1148 .set_mem_map = m8xx_set_mem_map, 1149 1149 }; 1150 1150 1151 - static int __init m8xx_probe(struct platform_device *ofdev, 1152 - const struct of_device_id *match) 1151 + static int __init m8xx_probe(struct platform_device *ofdev) 1153 1152 { 1154 1153 struct pcmcia_win *w; 1155 1154 unsigned int i, m, hwirq; ··· 1294 1295 1295 1296 MODULE_DEVICE_TABLE(of, m8xx_pcmcia_match); 1296 1297 1297 - static struct of_platform_driver m8xx_pcmcia_driver = { 1298 + static struct platform_driver m8xx_pcmcia_driver = { 1298 1299 .driver = { 1299 1300 .name = driver_name, 1300 1301 .owner = THIS_MODULE, ··· 1306 1307 1307 1308 static int __init m8xx_init(void) 1308 1309 { 1309 - return of_register_platform_driver(&m8xx_pcmcia_driver); 1310 + return platform_driver_register(&m8xx_pcmcia_driver); 1310 1311 } 1311 1312 1312 1313 static void __exit m8xx_exit(void) 1313 1314 { 1314 - of_unregister_platform_driver(&m8xx_pcmcia_driver); 1315 + platform_driver_unregister(&m8xx_pcmcia_driver); 1315 1316 } 1316 1317 1317 1318 module_init(m8xx_init);
+4 -5
drivers/rtc/rtc-mpc5121.c
··· 268 268 .update_irq_enable = mpc5121_rtc_update_irq_enable, 269 269 }; 270 270 271 - static int __devinit mpc5121_rtc_probe(struct platform_device *op, 272 - const struct of_device_id *match) 271 + static int __devinit mpc5121_rtc_probe(struct platform_device *op) 273 272 { 274 273 struct mpc5121_rtc_data *rtc; 275 274 int err = 0; ··· 363 364 {}, 364 365 }; 365 366 366 - static struct of_platform_driver mpc5121_rtc_driver = { 367 + static struct platform_driver mpc5121_rtc_driver = { 367 368 .driver = { 368 369 .name = "mpc5121-rtc", 369 370 .owner = THIS_MODULE, ··· 375 376 376 377 static int __init mpc5121_rtc_init(void) 377 378 { 378 - return of_register_platform_driver(&mpc5121_rtc_driver); 379 + return platform_driver_register(&mpc5121_rtc_driver); 379 380 } 380 381 module_init(mpc5121_rtc_init); 381 382 382 383 static void __exit mpc5121_rtc_exit(void) 383 384 { 384 - of_unregister_platform_driver(&mpc5121_rtc_driver); 385 + platform_driver_unregister(&mpc5121_rtc_driver); 385 386 } 386 387 module_exit(mpc5121_rtc_exit); 387 388
+4 -5
drivers/watchdog/cpwd.c
··· 528 528 .llseek = no_llseek, 529 529 }; 530 530 531 - static int __devinit cpwd_probe(struct platform_device *op, 532 - const struct of_device_id *match) 531 + static int __devinit cpwd_probe(struct platform_device *op) 533 532 { 534 533 struct device_node *options; 535 534 const char *str_prop; ··· 677 678 }; 678 679 MODULE_DEVICE_TABLE(of, cpwd_match); 679 680 680 - static struct of_platform_driver cpwd_driver = { 681 + static struct platform_driver cpwd_driver = { 681 682 .driver = { 682 683 .name = DRIVER_NAME, 683 684 .owner = THIS_MODULE, ··· 689 690 690 691 static int __init cpwd_init(void) 691 692 { 692 - return of_register_platform_driver(&cpwd_driver); 693 + return platform_driver_register(&cpwd_driver); 693 694 } 694 695 695 696 static void __exit cpwd_exit(void) 696 697 { 697 - of_unregister_platform_driver(&cpwd_driver); 698 + platform_driver_unregister(&cpwd_driver); 698 699 } 699 700 700 701 module_init(cpwd_init);
+4 -5
drivers/watchdog/gef_wdt.c
··· 261 261 }; 262 262 263 263 264 - static int __devinit gef_wdt_probe(struct platform_device *dev, 265 - const struct of_device_id *match) 264 + static int __devinit gef_wdt_probe(struct platform_device *dev) 266 265 { 267 266 int timeout = 10; 268 267 u32 freq; ··· 302 303 {}, 303 304 }; 304 305 305 - static struct of_platform_driver gef_wdt_driver = { 306 + static struct platform_driver gef_wdt_driver = { 306 307 .driver = { 307 308 .name = "gef_wdt", 308 309 .owner = THIS_MODULE, ··· 314 315 static int __init gef_wdt_init(void) 315 316 { 316 317 printk(KERN_INFO "GE watchdog driver\n"); 317 - return of_register_platform_driver(&gef_wdt_driver); 318 + return platform_driver_register(&gef_wdt_driver); 318 319 } 319 320 320 321 static void __exit gef_wdt_exit(void) 321 322 { 322 - of_unregister_platform_driver(&gef_wdt_driver); 323 + platform_driver_unregister(&gef_wdt_driver); 323 324 } 324 325 325 326 module_init(gef_wdt_init);
+9 -6
drivers/watchdog/mpc8xxx_wdt.c
··· 185 185 .fops = &mpc8xxx_wdt_fops, 186 186 }; 187 187 188 - static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev, 189 - const struct of_device_id *match) 188 + static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev) 190 189 { 191 190 int ret; 192 191 struct device_node *np = ofdev->dev.of_node; 193 - struct mpc8xxx_wdt_type *wdt_type = match->data; 192 + struct mpc8xxx_wdt_type *wdt_type; 194 193 u32 freq = fsl_get_sys_freq(); 195 194 bool enabled; 195 + 196 + if (!ofdev->dev.of_match) 197 + return -EINVAL; 198 + wdt_type = match->data; 196 199 197 200 if (!freq || freq == -1) 198 201 return -EINVAL; ··· 275 272 }; 276 273 MODULE_DEVICE_TABLE(of, mpc8xxx_wdt_match); 277 274 278 - static struct of_platform_driver mpc8xxx_wdt_driver = { 275 + static struct platform_driver mpc8xxx_wdt_driver = { 279 276 .probe = mpc8xxx_wdt_probe, 280 277 .remove = __devexit_p(mpc8xxx_wdt_remove), 281 278 .driver = { ··· 311 308 312 309 static int __init mpc8xxx_wdt_init(void) 313 310 { 314 - return of_register_platform_driver(&mpc8xxx_wdt_driver); 311 + return platform_driver_register(&mpc8xxx_wdt_driver); 315 312 } 316 313 arch_initcall(mpc8xxx_wdt_init); 317 314 318 315 static void __exit mpc8xxx_wdt_exit(void) 319 316 { 320 - of_unregister_platform_driver(&mpc8xxx_wdt_driver); 317 + platform_driver_unregister(&mpc8xxx_wdt_driver); 321 318 } 322 319 module_exit(mpc8xxx_wdt_exit); 323 320
+4 -5
drivers/watchdog/riowd.c
··· 172 172 .fops = &riowd_fops 173 173 }; 174 174 175 - static int __devinit riowd_probe(struct platform_device *op, 176 - const struct of_device_id *match) 175 + static int __devinit riowd_probe(struct platform_device *op) 177 176 { 178 177 struct riowd *p; 179 178 int err = -EINVAL; ··· 237 238 }; 238 239 MODULE_DEVICE_TABLE(of, riowd_match); 239 240 240 - static struct of_platform_driver riowd_driver = { 241 + static struct platform_driver riowd_driver = { 241 242 .driver = { 242 243 .name = DRIVER_NAME, 243 244 .owner = THIS_MODULE, ··· 249 250 250 251 static int __init riowd_init(void) 251 252 { 252 - return of_register_platform_driver(&riowd_driver); 253 + return platform_driver_register(&riowd_driver); 253 254 } 254 255 255 256 static void __exit riowd_exit(void) 256 257 { 257 - of_unregister_platform_driver(&riowd_driver); 258 + platform_driver_unregister(&riowd_driver); 258 259 } 259 260 260 261 module_init(riowd_init);