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

Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6

* 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6: (21 commits)
tty: serial: altera_jtaguart: Add device tree support
tty: serial: altera_uart: Add devicetree support
dt: eliminate of_platform_driver shim code
dt: Eliminate of_platform_{,un}register_driver
dt/serial: Eliminate users of of_platform_{,un}register_driver
dt/usb: Eliminate users of of_platform_{,un}register_driver
dt/video: Eliminate users of of_platform_{,un}register_driver
dt/net: Eliminate users of of_platform_{,un}register_driver
dt/sound: Eliminate users of of_platform_{,un}register_driver
dt/spi: Eliminate users of of_platform_{,un}register_driver
dt: uartlite: merge platform and of_platform driver bindings
dt: xilinx_hwicap: merge platform and of_platform driver bindings
ipmi: convert OF driver to platform driver
leds/leds-gpio: merge platform_driver with of_platform_driver
dt/sparc: Eliminate users of of_platform_{,un}register_driver
dt/powerpc: Eliminate users of of_platform_{,un}register_driver
dt/powerpc: move of_bus_type infrastructure to ibmebus
drivercore/dt: add a match table pointer to struct device
dt: Typo fix.
altera_ps2: Add devicetree support
...

+1423 -1741
+4
Documentation/devicetree/bindings/serial/altera_jtaguart.txt
··· 1 + Altera JTAG UART 2 + 3 + Required properties: 4 + - compatible : should be "ALTR,juart-1.0"
+7
Documentation/devicetree/bindings/serial/altera_uart.txt
··· 1 + Altera UART 2 + 3 + Required properties: 4 + - compatible : should be "ALTR,uart-1.0" 5 + 6 + Optional properties: 7 + - clock-frequency : frequency of the clock input to the UART
+4
Documentation/devicetree/bindings/serio/altera_ps2.txt
··· 1 + Altera UP PS/2 controller 2 + 3 + Required properties: 4 + - compatible : should be "ALTR,ps2-1.0".
+1
arch/microblaze/pci/pci_32.c
··· 332 332 hose->global_number); 333 333 return; 334 334 } 335 + bus.dev->of_node = of_node_get(node); 335 336 bus->secondary = hose->first_busno; 336 337 hose->bus = bus; 337 338
+5 -22
arch/powerpc/include/asm/pci-bridge.h
··· 164 164 resource_size_t cfg_addr, 165 165 resource_size_t cfg_data, u32 flags); 166 166 167 - #ifndef CONFIG_PPC64 168 - 169 167 static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus) 170 168 { 171 169 return bus->sysdata; 172 170 } 171 + 172 + #ifndef CONFIG_PPC64 173 173 174 174 static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) 175 175 { ··· 228 228 229 229 /* Get a device_node from a pci_dev. This code must be fast except 230 230 * in the case where the sysdata is incorrect and needs to be fixed 231 - * up (this will only happen once). 232 - * In this case the sysdata will have been inherited from a PCI host 233 - * bridge or a PCI-PCI bridge further up the tree, so it will point 234 - * to a valid struct pci_dn, just not the one we want. 235 - */ 231 + * up (this will only happen once). */ 236 232 static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev) 237 233 { 238 - struct device_node *dn = dev->sysdata; 239 - struct pci_dn *pdn = dn->data; 240 - 241 - if (pdn && pdn->devfn == dev->devfn && pdn->busno == dev->bus->number) 242 - return dn; /* fast path. sysdata is good */ 243 - return fetch_dev_dn(dev); 234 + return dev->dev.of_node ? dev->dev.of_node : fetch_dev_dn(dev); 244 235 } 245 236 246 237 static inline int pci_device_from_OF_node(struct device_node *np, ··· 249 258 if (bus->self) 250 259 return pci_device_to_OF_node(bus->self); 251 260 else 252 - return bus->sysdata; /* Must be root bus (PHB) */ 261 + return bus->dev.of_node; /* Must be root bus (PHB) */ 253 262 } 254 263 255 264 /** Find the bus corresponding to the indicated device node */ ··· 260 269 261 270 /** Discover new pci devices under this bus, and add them */ 262 271 extern void pcibios_add_pci_devices(struct pci_bus *bus); 263 - 264 - static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus) 265 - { 266 - struct device_node *busdn = bus->sysdata; 267 - 268 - BUG_ON(busdn == NULL); 269 - return PCI_DN(busdn)->phb; 270 - } 271 272 272 273 273 274 extern void isa_bridge_find_early(struct pci_controller *hose);
+1 -1
arch/powerpc/include/asm/pci.h
··· 201 201 extern void pcibios_setup_bus_devices(struct pci_bus *bus); 202 202 extern void pcibios_setup_bus_self(struct pci_bus *bus); 203 203 extern void pcibios_setup_phb_io_space(struct pci_controller *hose); 204 - extern void pcibios_scan_phb(struct pci_controller *hose, void *sysdata); 204 + extern void pcibios_scan_phb(struct pci_controller *hose); 205 205 206 206 #endif /* __KERNEL__ */ 207 207 #endif /* __ASM_POWERPC_PCI_H */
+400 -4
arch/powerpc/kernel/ibmebus.c
··· 201 201 /* If the driver uses devices that ibmebus doesn't know, add them */ 202 202 ibmebus_create_devices(drv->driver.of_match_table); 203 203 204 - return of_register_driver(drv, &ibmebus_bus_type); 204 + drv->driver.bus = &ibmebus_bus_type; 205 + return driver_register(&drv->driver); 205 206 } 206 207 EXPORT_SYMBOL(ibmebus_register_driver); 207 208 208 209 void ibmebus_unregister_driver(struct of_platform_driver *drv) 209 210 { 210 - of_unregister_driver(drv); 211 + driver_unregister(&drv->driver); 211 212 } 212 213 EXPORT_SYMBOL(ibmebus_unregister_driver); 213 214 ··· 309 308 } 310 309 } 311 310 311 + 312 312 static struct bus_attribute ibmebus_bus_attrs[] = { 313 313 __ATTR(probe, S_IWUSR, NULL, ibmebus_store_probe), 314 314 __ATTR(remove, S_IWUSR, NULL, ibmebus_store_remove), 315 315 __ATTR_NULL 316 316 }; 317 317 318 + static int ibmebus_bus_bus_match(struct device *dev, struct device_driver *drv) 319 + { 320 + const struct of_device_id *matches = drv->of_match_table; 321 + 322 + if (!matches) 323 + return 0; 324 + 325 + return of_match_device(matches, dev) != NULL; 326 + } 327 + 328 + static int ibmebus_bus_device_probe(struct device *dev) 329 + { 330 + int error = -ENODEV; 331 + struct of_platform_driver *drv; 332 + struct platform_device *of_dev; 333 + const struct of_device_id *match; 334 + 335 + drv = to_of_platform_driver(dev->driver); 336 + of_dev = to_platform_device(dev); 337 + 338 + if (!drv->probe) 339 + return error; 340 + 341 + of_dev_get(of_dev); 342 + 343 + match = of_match_device(drv->driver.of_match_table, dev); 344 + if (match) 345 + error = drv->probe(of_dev, match); 346 + if (error) 347 + of_dev_put(of_dev); 348 + 349 + return error; 350 + } 351 + 352 + static int ibmebus_bus_device_remove(struct device *dev) 353 + { 354 + struct platform_device *of_dev = to_platform_device(dev); 355 + struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 356 + 357 + if (dev->driver && drv->remove) 358 + drv->remove(of_dev); 359 + return 0; 360 + } 361 + 362 + static void ibmebus_bus_device_shutdown(struct device *dev) 363 + { 364 + struct platform_device *of_dev = to_platform_device(dev); 365 + struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 366 + 367 + if (dev->driver && drv->shutdown) 368 + drv->shutdown(of_dev); 369 + } 370 + 371 + /* 372 + * ibmebus_bus_device_attrs 373 + */ 374 + static ssize_t devspec_show(struct device *dev, 375 + struct device_attribute *attr, char *buf) 376 + { 377 + struct platform_device *ofdev; 378 + 379 + ofdev = to_platform_device(dev); 380 + return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name); 381 + } 382 + 383 + static ssize_t name_show(struct device *dev, 384 + struct device_attribute *attr, char *buf) 385 + { 386 + struct platform_device *ofdev; 387 + 388 + ofdev = to_platform_device(dev); 389 + return sprintf(buf, "%s\n", ofdev->dev.of_node->name); 390 + } 391 + 392 + static ssize_t modalias_show(struct device *dev, 393 + struct device_attribute *attr, char *buf) 394 + { 395 + ssize_t len = of_device_get_modalias(dev, buf, PAGE_SIZE - 2); 396 + buf[len] = '\n'; 397 + buf[len+1] = 0; 398 + return len+1; 399 + } 400 + 401 + struct device_attribute ibmebus_bus_device_attrs[] = { 402 + __ATTR_RO(devspec), 403 + __ATTR_RO(name), 404 + __ATTR_RO(modalias), 405 + __ATTR_NULL 406 + }; 407 + 408 + #ifdef CONFIG_PM_SLEEP 409 + static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg) 410 + { 411 + struct platform_device *of_dev = to_platform_device(dev); 412 + struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 413 + int ret = 0; 414 + 415 + if (dev->driver && drv->suspend) 416 + ret = drv->suspend(of_dev, mesg); 417 + return ret; 418 + } 419 + 420 + static int ibmebus_bus_legacy_resume(struct device *dev) 421 + { 422 + struct platform_device *of_dev = to_platform_device(dev); 423 + struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 424 + int ret = 0; 425 + 426 + if (dev->driver && drv->resume) 427 + ret = drv->resume(of_dev); 428 + return ret; 429 + } 430 + 431 + static int ibmebus_bus_pm_prepare(struct device *dev) 432 + { 433 + struct device_driver *drv = dev->driver; 434 + int ret = 0; 435 + 436 + if (drv && drv->pm && drv->pm->prepare) 437 + ret = drv->pm->prepare(dev); 438 + 439 + return ret; 440 + } 441 + 442 + static void ibmebus_bus_pm_complete(struct device *dev) 443 + { 444 + struct device_driver *drv = dev->driver; 445 + 446 + if (drv && drv->pm && drv->pm->complete) 447 + drv->pm->complete(dev); 448 + } 449 + 450 + #ifdef CONFIG_SUSPEND 451 + 452 + static int ibmebus_bus_pm_suspend(struct device *dev) 453 + { 454 + struct device_driver *drv = dev->driver; 455 + int ret = 0; 456 + 457 + if (!drv) 458 + return 0; 459 + 460 + if (drv->pm) { 461 + if (drv->pm->suspend) 462 + ret = drv->pm->suspend(dev); 463 + } else { 464 + ret = ibmebus_bus_legacy_suspend(dev, PMSG_SUSPEND); 465 + } 466 + 467 + return ret; 468 + } 469 + 470 + static int ibmebus_bus_pm_suspend_noirq(struct device *dev) 471 + { 472 + struct device_driver *drv = dev->driver; 473 + int ret = 0; 474 + 475 + if (!drv) 476 + return 0; 477 + 478 + if (drv->pm) { 479 + if (drv->pm->suspend_noirq) 480 + ret = drv->pm->suspend_noirq(dev); 481 + } 482 + 483 + return ret; 484 + } 485 + 486 + static int ibmebus_bus_pm_resume(struct device *dev) 487 + { 488 + struct device_driver *drv = dev->driver; 489 + int ret = 0; 490 + 491 + if (!drv) 492 + return 0; 493 + 494 + if (drv->pm) { 495 + if (drv->pm->resume) 496 + ret = drv->pm->resume(dev); 497 + } else { 498 + ret = ibmebus_bus_legacy_resume(dev); 499 + } 500 + 501 + return ret; 502 + } 503 + 504 + static int ibmebus_bus_pm_resume_noirq(struct device *dev) 505 + { 506 + struct device_driver *drv = dev->driver; 507 + int ret = 0; 508 + 509 + if (!drv) 510 + return 0; 511 + 512 + if (drv->pm) { 513 + if (drv->pm->resume_noirq) 514 + ret = drv->pm->resume_noirq(dev); 515 + } 516 + 517 + return ret; 518 + } 519 + 520 + #else /* !CONFIG_SUSPEND */ 521 + 522 + #define ibmebus_bus_pm_suspend NULL 523 + #define ibmebus_bus_pm_resume NULL 524 + #define ibmebus_bus_pm_suspend_noirq NULL 525 + #define ibmebus_bus_pm_resume_noirq NULL 526 + 527 + #endif /* !CONFIG_SUSPEND */ 528 + 529 + #ifdef CONFIG_HIBERNATION 530 + 531 + static int ibmebus_bus_pm_freeze(struct device *dev) 532 + { 533 + struct device_driver *drv = dev->driver; 534 + int ret = 0; 535 + 536 + if (!drv) 537 + return 0; 538 + 539 + if (drv->pm) { 540 + if (drv->pm->freeze) 541 + ret = drv->pm->freeze(dev); 542 + } else { 543 + ret = ibmebus_bus_legacy_suspend(dev, PMSG_FREEZE); 544 + } 545 + 546 + return ret; 547 + } 548 + 549 + static int ibmebus_bus_pm_freeze_noirq(struct device *dev) 550 + { 551 + struct device_driver *drv = dev->driver; 552 + int ret = 0; 553 + 554 + if (!drv) 555 + return 0; 556 + 557 + if (drv->pm) { 558 + if (drv->pm->freeze_noirq) 559 + ret = drv->pm->freeze_noirq(dev); 560 + } 561 + 562 + return ret; 563 + } 564 + 565 + static int ibmebus_bus_pm_thaw(struct device *dev) 566 + { 567 + struct device_driver *drv = dev->driver; 568 + int ret = 0; 569 + 570 + if (!drv) 571 + return 0; 572 + 573 + if (drv->pm) { 574 + if (drv->pm->thaw) 575 + ret = drv->pm->thaw(dev); 576 + } else { 577 + ret = ibmebus_bus_legacy_resume(dev); 578 + } 579 + 580 + return ret; 581 + } 582 + 583 + static int ibmebus_bus_pm_thaw_noirq(struct device *dev) 584 + { 585 + struct device_driver *drv = dev->driver; 586 + int ret = 0; 587 + 588 + if (!drv) 589 + return 0; 590 + 591 + if (drv->pm) { 592 + if (drv->pm->thaw_noirq) 593 + ret = drv->pm->thaw_noirq(dev); 594 + } 595 + 596 + return ret; 597 + } 598 + 599 + static int ibmebus_bus_pm_poweroff(struct device *dev) 600 + { 601 + struct device_driver *drv = dev->driver; 602 + int ret = 0; 603 + 604 + if (!drv) 605 + return 0; 606 + 607 + if (drv->pm) { 608 + if (drv->pm->poweroff) 609 + ret = drv->pm->poweroff(dev); 610 + } else { 611 + ret = ibmebus_bus_legacy_suspend(dev, PMSG_HIBERNATE); 612 + } 613 + 614 + return ret; 615 + } 616 + 617 + static int ibmebus_bus_pm_poweroff_noirq(struct device *dev) 618 + { 619 + struct device_driver *drv = dev->driver; 620 + int ret = 0; 621 + 622 + if (!drv) 623 + return 0; 624 + 625 + if (drv->pm) { 626 + if (drv->pm->poweroff_noirq) 627 + ret = drv->pm->poweroff_noirq(dev); 628 + } 629 + 630 + return ret; 631 + } 632 + 633 + static int ibmebus_bus_pm_restore(struct device *dev) 634 + { 635 + struct device_driver *drv = dev->driver; 636 + int ret = 0; 637 + 638 + if (!drv) 639 + return 0; 640 + 641 + if (drv->pm) { 642 + if (drv->pm->restore) 643 + ret = drv->pm->restore(dev); 644 + } else { 645 + ret = ibmebus_bus_legacy_resume(dev); 646 + } 647 + 648 + return ret; 649 + } 650 + 651 + static int ibmebus_bus_pm_restore_noirq(struct device *dev) 652 + { 653 + struct device_driver *drv = dev->driver; 654 + int ret = 0; 655 + 656 + if (!drv) 657 + return 0; 658 + 659 + if (drv->pm) { 660 + if (drv->pm->restore_noirq) 661 + ret = drv->pm->restore_noirq(dev); 662 + } 663 + 664 + return ret; 665 + } 666 + 667 + #else /* !CONFIG_HIBERNATION */ 668 + 669 + #define ibmebus_bus_pm_freeze NULL 670 + #define ibmebus_bus_pm_thaw NULL 671 + #define ibmebus_bus_pm_poweroff NULL 672 + #define ibmebus_bus_pm_restore NULL 673 + #define ibmebus_bus_pm_freeze_noirq NULL 674 + #define ibmebus_bus_pm_thaw_noirq NULL 675 + #define ibmebus_bus_pm_poweroff_noirq NULL 676 + #define ibmebus_bus_pm_restore_noirq NULL 677 + 678 + #endif /* !CONFIG_HIBERNATION */ 679 + 680 + static struct dev_pm_ops ibmebus_bus_dev_pm_ops = { 681 + .prepare = ibmebus_bus_pm_prepare, 682 + .complete = ibmebus_bus_pm_complete, 683 + .suspend = ibmebus_bus_pm_suspend, 684 + .resume = ibmebus_bus_pm_resume, 685 + .freeze = ibmebus_bus_pm_freeze, 686 + .thaw = ibmebus_bus_pm_thaw, 687 + .poweroff = ibmebus_bus_pm_poweroff, 688 + .restore = ibmebus_bus_pm_restore, 689 + .suspend_noirq = ibmebus_bus_pm_suspend_noirq, 690 + .resume_noirq = ibmebus_bus_pm_resume_noirq, 691 + .freeze_noirq = ibmebus_bus_pm_freeze_noirq, 692 + .thaw_noirq = ibmebus_bus_pm_thaw_noirq, 693 + .poweroff_noirq = ibmebus_bus_pm_poweroff_noirq, 694 + .restore_noirq = ibmebus_bus_pm_restore_noirq, 695 + }; 696 + 697 + #define IBMEBUS_BUS_PM_OPS_PTR (&ibmebus_bus_dev_pm_ops) 698 + 699 + #else /* !CONFIG_PM_SLEEP */ 700 + 701 + #define IBMEBUS_BUS_PM_OPS_PTR NULL 702 + 703 + #endif /* !CONFIG_PM_SLEEP */ 704 + 318 705 struct bus_type ibmebus_bus_type = { 706 + .name = "ibmebus", 319 707 .uevent = of_device_uevent, 320 - .bus_attrs = ibmebus_bus_attrs 708 + .bus_attrs = ibmebus_bus_attrs, 709 + .match = ibmebus_bus_bus_match, 710 + .probe = ibmebus_bus_device_probe, 711 + .remove = ibmebus_bus_device_remove, 712 + .shutdown = ibmebus_bus_device_shutdown, 713 + .dev_attrs = ibmebus_bus_device_attrs, 714 + .pm = IBMEBUS_BUS_PM_OPS_PTR, 321 715 }; 322 716 EXPORT_SYMBOL(ibmebus_bus_type); 323 717 ··· 722 326 723 327 printk(KERN_INFO "IBM eBus Device Driver\n"); 724 328 725 - err = of_bus_type_init(&ibmebus_bus_type, "ibmebus"); 329 + err = bus_register(&ibmebus_bus_type); 726 330 if (err) { 727 331 printk(KERN_ERR "%s: failed to register IBM eBus.\n", 728 332 __func__);
+4 -5
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 ··· 73 74 #endif /* CONFIG_EEH */ 74 75 75 76 /* Scan the bus */ 76 - pcibios_scan_phb(phb, dev->dev.of_node); 77 + pcibios_scan_phb(phb); 77 78 if (phb->bus == NULL) 78 79 return -ENXIO; 79 80 ··· 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);
+3 -8
arch/powerpc/kernel/pci-common.c
··· 1688 1688 /** 1689 1689 * pci_scan_phb - Given a pci_controller, setup and scan the PCI bus 1690 1690 * @hose: Pointer to the PCI host controller instance structure 1691 - * @sysdata: value to use for sysdata pointer. ppc32 and ppc64 differ here 1692 - * 1693 - * Note: the 'data' pointer is a temporary measure. As 32 and 64 bit 1694 - * pci code gets merged, this parameter should become unnecessary because 1695 - * both will use the same value. 1696 1691 */ 1697 - void __devinit pcibios_scan_phb(struct pci_controller *hose, void *sysdata) 1692 + void __devinit pcibios_scan_phb(struct pci_controller *hose) 1698 1693 { 1699 1694 struct pci_bus *bus; 1700 1695 struct device_node *node = hose->dn; ··· 1699 1704 node ? node->full_name : "<NO NAME>"); 1700 1705 1701 1706 /* Create an empty bus for the toplevel */ 1702 - bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops, 1703 - sysdata); 1707 + bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops, hose); 1704 1708 if (bus == NULL) { 1705 1709 pr_err("Failed to create bus for PCI domain %04x\n", 1706 1710 hose->global_number); 1707 1711 return; 1708 1712 } 1713 + bus->dev.of_node = of_node_get(node); 1709 1714 bus->secondary = hose->first_busno; 1710 1715 hose->bus = bus; 1711 1716
+1 -1
arch/powerpc/kernel/pci_32.c
··· 381 381 if (pci_assign_all_buses) 382 382 hose->first_busno = next_busno; 383 383 hose->last_busno = 0xff; 384 - pcibios_scan_phb(hose, hose); 384 + pcibios_scan_phb(hose); 385 385 pci_bus_add_devices(hose->bus); 386 386 if (pci_assign_all_buses || next_busno <= hose->last_busno) 387 387 next_busno = hose->last_busno + pcibios_assign_bus_offset;
+3 -3
arch/powerpc/kernel/pci_64.c
··· 64 64 65 65 /* Scan all of the recorded PCI controllers. */ 66 66 list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { 67 - pcibios_scan_phb(hose, hose->dn); 67 + pcibios_scan_phb(hose); 68 68 pci_bus_add_devices(hose->bus); 69 69 } 70 70 ··· 242 242 break; 243 243 bus = NULL; 244 244 } 245 - if (bus == NULL || bus->sysdata == NULL) 245 + if (bus == NULL || bus->dev.of_node == NULL) 246 246 return -ENODEV; 247 247 248 - hose_node = (struct device_node *)bus->sysdata; 248 + hose_node = bus->dev.of_node; 249 249 hose = PCI_DN(hose_node)->phb; 250 250 251 251 switch (which) {
+6 -3
arch/powerpc/kernel/pci_dn.c
··· 161 161 /* 162 162 * This is the "slow" path for looking up a device_node from a 163 163 * pci_dev. It will hunt for the device under its parent's 164 - * phb and then update sysdata for a future fastpath. 164 + * phb and then update of_node pointer. 165 165 * 166 166 * It may also do fixups on the actual device since this happens 167 167 * on the first read/write. ··· 170 170 * In this case it may probe for real hardware ("just in case") 171 171 * and add a device_node to the device tree if necessary. 172 172 * 173 + * Is this function necessary anymore now that dev->dev.of_node is 174 + * used to store the node pointer? 175 + * 173 176 */ 174 177 struct device_node *fetch_dev_dn(struct pci_dev *dev) 175 178 { 176 - struct device_node *orig_dn = dev->sysdata; 179 + struct device_node *orig_dn = dev->dev.of_node; 177 180 struct device_node *dn; 178 181 unsigned long searchval = (dev->bus->number << 8) | dev->devfn; 179 182 180 183 dn = traverse_pci_devices(orig_dn, is_devfn_node, (void *)searchval); 181 184 if (dn) 182 - dev->sysdata = dn; 185 + dev->dev.of_node = dn; 183 186 return dn; 184 187 } 185 188 EXPORT_SYMBOL(fetch_dev_dn);
+2 -2
arch/powerpc/kernel/pci_of_scan.c
··· 135 135 pr_debug(" create device, devfn: %x, type: %s\n", devfn, type); 136 136 137 137 dev->bus = bus; 138 - dev->sysdata = node; 138 + dev->dev.of_node = of_node_get(node); 139 139 dev->dev.parent = bus->bridge; 140 140 dev->dev.bus = &pci_bus_type; 141 141 dev->devfn = devfn; ··· 238 238 bus->primary = dev->bus->number; 239 239 bus->subordinate = busrange[1]; 240 240 bus->bridge_ctl = 0; 241 - bus->sysdata = node; 241 + bus->dev.of_node = of_node_get(node); 242 242 243 243 /* parse ranges property */ 244 244 /* PCI #address-cells == 3 and #size-cells == 2 always */
+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 }
+1 -1
arch/powerpc/platforms/pseries/pci_dlpar.c
··· 149 149 if (dn->child) 150 150 eeh_add_device_tree_early(dn); 151 151 152 - pcibios_scan_phb(phb, dn); 152 + pcibios_scan_phb(phb); 153 153 pcibios_finish_adding_to_bus(phb->bus); 154 154 155 155 return phb;
+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) */
+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
··· 137 137 }, 138 138 }; 139 139 140 - static int __devinit clock_probe(struct platform_device *op, const struct of_device_id *match) 140 + static int __devinit clock_probe(struct platform_device *op) 141 141 { 142 142 struct device_node *dp = op->dev.of_node; 143 143 const char *model = of_get_property(dp, "model", NULL); ··· 171 171 {}, 172 172 }; 173 173 174 - static struct of_platform_driver clock_driver = { 174 + static struct platform_driver clock_driver = { 175 175 .probe = clock_probe, 176 176 .driver = { 177 177 .name = "rtc", ··· 184 184 /* Probe for the mostek real time clock chip. */ 185 185 static int __init clock_init(void) 186 186 { 187 - return of_register_platform_driver(&clock_driver); 187 + return platform_driver_register(&clock_driver); 188 188 } 189 189 /* Must be after subsys_initcall() so that busses are probed. Must 190 190 * 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 }
+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
··· 1625 1625 }, 1626 1626 }; 1627 1627 1628 - static int sata_dwc_probe(struct platform_device *ofdev, 1629 - const struct of_device_id *match) 1628 + static int sata_dwc_probe(struct platform_device *ofdev) 1630 1629 { 1631 1630 struct sata_dwc_device *hsdev; 1632 1631 u32 idr, versionr; ··· 1763 1764 }; 1764 1765 MODULE_DEVICE_TABLE(of, sata_dwc_match); 1765 1766 1766 - static struct of_platform_driver sata_dwc_driver = { 1767 + static struct platform_driver sata_dwc_driver = { 1767 1768 .driver = { 1768 1769 .name = DRV_NAME, 1769 1770 .owner = THIS_MODULE, ··· 1775 1776 1776 1777 static int __init sata_dwc_init(void) 1777 1778 { 1778 - return of_register_platform_driver(&sata_dwc_driver); 1779 + return platform_driver_register(&sata_dwc_driver); 1779 1780 } 1780 1781 1781 1782 static void __exit sata_dwc_exit(void) 1782 1783 { 1783 - of_unregister_platform_driver(&sata_dwc_driver); 1784 + platform_driver_unregister(&sata_dwc_driver); 1784 1785 } 1785 1786 1786 1787 module_init(sata_dwc_init);
+4 -5
drivers/ata/sata_fsl.c
··· 1300 1300 }, 1301 1301 }; 1302 1302 1303 - static int sata_fsl_probe(struct platform_device *ofdev, 1304 - const struct of_device_id *match) 1303 + static int sata_fsl_probe(struct platform_device *ofdev) 1305 1304 { 1306 1305 int retval = -ENXIO; 1307 1306 void __iomem *hcr_base = NULL; ··· 1436 1437 1437 1438 MODULE_DEVICE_TABLE(of, fsl_sata_match); 1438 1439 1439 - static struct of_platform_driver fsl_sata_driver = { 1440 + static struct platform_driver fsl_sata_driver = { 1440 1441 .driver = { 1441 1442 .name = "fsl-sata", 1442 1443 .owner = THIS_MODULE, ··· 1452 1453 1453 1454 static int __init sata_fsl_init(void) 1454 1455 { 1455 - of_register_platform_driver(&fsl_sata_driver); 1456 + platform_driver_register(&fsl_sata_driver); 1456 1457 return 0; 1457 1458 } 1458 1459 1459 1460 static void __exit sata_fsl_exit(void) 1460 1461 { 1461 - of_unregister_platform_driver(&fsl_sata_driver); 1462 + platform_driver_unregister(&fsl_sata_driver); 1462 1463 } 1463 1464 1464 1465 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 */
+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);
+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
+23 -47
drivers/char/ipmi/ipmi_si_intf.c
··· 66 66 #include <linux/string.h> 67 67 #include <linux/ctype.h> 68 68 #include <linux/pnp.h> 69 - 70 - #ifdef CONFIG_PPC_OF 71 69 #include <linux/of_device.h> 72 70 #include <linux/of_platform.h> 73 71 #include <linux/of_address.h> 74 72 #include <linux/of_irq.h> 75 - #endif 76 73 77 74 #define PFX "ipmi_si: " 78 75 ··· 113 116 114 117 #define DEVICE_NAME "ipmi_si" 115 118 116 - static struct platform_driver ipmi_driver = { 117 - .driver = { 118 - .name = DEVICE_NAME, 119 - .bus = &platform_bus_type 120 - } 121 - }; 122 - 119 + static struct platform_driver ipmi_driver; 123 120 124 121 /* 125 122 * Indexes into stats[] in smi_info below. ··· 298 307 #endif 299 308 #ifdef CONFIG_ACPI 300 309 static int pnp_registered; 301 - #endif 302 - #ifdef CONFIG_PPC_OF 303 - static int of_registered; 304 310 #endif 305 311 306 312 static unsigned int kipmid_max_busy_us[SI_MAX_PARMS]; ··· 1856 1868 return rv; 1857 1869 } 1858 1870 1859 - static void __devinit hardcode_find_bmc(void) 1871 + static int __devinit hardcode_find_bmc(void) 1860 1872 { 1873 + int ret = -ENODEV; 1861 1874 int i; 1862 1875 struct smi_info *info; 1863 1876 ··· 1868 1879 1869 1880 info = smi_info_alloc(); 1870 1881 if (!info) 1871 - return; 1882 + return -ENOMEM; 1872 1883 1873 1884 info->addr_source = SI_HARDCODED; 1874 1885 printk(KERN_INFO PFX "probing via hardcoded address\n"); ··· 1921 1932 if (!add_smi(info)) { 1922 1933 if (try_smi_init(info)) 1923 1934 cleanup_one_si(info); 1935 + ret = 0; 1924 1936 } else { 1925 1937 kfree(info); 1926 1938 } 1927 1939 } 1940 + return ret; 1928 1941 } 1929 1942 1930 1943 #ifdef CONFIG_ACPI ··· 2554 2563 }; 2555 2564 #endif /* CONFIG_PCI */ 2556 2565 2557 - 2558 - #ifdef CONFIG_PPC_OF 2559 - static int __devinit ipmi_of_probe(struct platform_device *dev, 2560 - const struct of_device_id *match) 2566 + static int __devinit ipmi_probe(struct platform_device *dev) 2561 2567 { 2568 + #ifdef CONFIG_OF 2562 2569 struct smi_info *info; 2563 2570 struct resource resource; 2564 2571 const __be32 *regsize, *regspacing, *regshift; ··· 2565 2576 int proplen; 2566 2577 2567 2578 dev_info(&dev->dev, "probing via device tree\n"); 2579 + 2580 + if (!dev->dev.of_match) 2581 + return -EINVAL; 2568 2582 2569 2583 ret = of_address_to_resource(np, 0, &resource); 2570 2584 if (ret) { ··· 2601 2609 return -ENOMEM; 2602 2610 } 2603 2611 2604 - info->si_type = (enum si_type) match->data; 2612 + info->si_type = (enum si_type) dev->dev.of_match->data; 2605 2613 info->addr_source = SI_DEVICETREE; 2606 2614 info->irq_setup = std_irq_setup; 2607 2615 ··· 2632 2640 kfree(info); 2633 2641 return -EBUSY; 2634 2642 } 2635 - 2643 + #endif 2636 2644 return 0; 2637 2645 } 2638 2646 2639 - static int __devexit ipmi_of_remove(struct platform_device *dev) 2647 + static int __devexit ipmi_remove(struct platform_device *dev) 2640 2648 { 2649 + #ifdef CONFIG_OF 2641 2650 cleanup_one_si(dev_get_drvdata(&dev->dev)); 2651 + #endif 2642 2652 return 0; 2643 2653 } 2644 2654 ··· 2655 2661 {}, 2656 2662 }; 2657 2663 2658 - static struct of_platform_driver ipmi_of_platform_driver = { 2664 + static struct platform_driver ipmi_driver = { 2659 2665 .driver = { 2660 - .name = "ipmi", 2666 + .name = DEVICE_NAME, 2661 2667 .owner = THIS_MODULE, 2662 2668 .of_match_table = ipmi_match, 2663 2669 }, 2664 - .probe = ipmi_of_probe, 2665 - .remove = __devexit_p(ipmi_of_remove), 2670 + .probe = ipmi_probe, 2671 + .remove = __devexit_p(ipmi_remove), 2666 2672 }; 2667 - #endif /* CONFIG_PPC_OF */ 2668 2673 2669 2674 static int wait_for_msg_done(struct smi_info *smi_info) 2670 2675 { ··· 3341 3348 return 0; 3342 3349 initialized = 1; 3343 3350 3344 - /* Register the device drivers. */ 3345 - rv = driver_register(&ipmi_driver.driver); 3351 + rv = platform_driver_register(&ipmi_driver); 3346 3352 if (rv) { 3347 3353 printk(KERN_ERR PFX "Unable to register driver: %d\n", rv); 3348 3354 return rv; ··· 3365 3373 3366 3374 printk(KERN_INFO "IPMI System Interface driver.\n"); 3367 3375 3368 - hardcode_find_bmc(); 3369 - 3370 3376 /* If the user gave us a device, they presumably want us to use it */ 3371 - mutex_lock(&smi_infos_lock); 3372 - if (!list_empty(&smi_infos)) { 3373 - mutex_unlock(&smi_infos_lock); 3377 + if (!hardcode_find_bmc()) 3374 3378 return 0; 3375 - } 3376 - mutex_unlock(&smi_infos_lock); 3377 3379 3378 3380 #ifdef CONFIG_PCI 3379 3381 rv = pci_register_driver(&ipmi_pci_driver); ··· 3388 3402 3389 3403 #ifdef CONFIG_ACPI 3390 3404 spmi_find_bmc(); 3391 - #endif 3392 - 3393 - #ifdef CONFIG_PPC_OF 3394 - of_register_platform_driver(&ipmi_of_platform_driver); 3395 - of_registered = 1; 3396 3405 #endif 3397 3406 3398 3407 /* We prefer devices with interrupts, but in the case of a machine ··· 3537 3556 pnp_unregister_driver(&ipmi_pnp_driver); 3538 3557 #endif 3539 3558 3540 - #ifdef CONFIG_PPC_OF 3541 - if (of_registered) 3542 - of_unregister_platform_driver(&ipmi_of_platform_driver); 3543 - #endif 3559 + platform_driver_unregister(&ipmi_driver); 3544 3560 3545 3561 mutex_lock(&smi_infos_lock); 3546 3562 list_for_each_entry_safe(e, tmp_e, &smi_infos, link) 3547 3563 cleanup_one_si(e); 3548 3564 mutex_unlock(&smi_infos_lock); 3549 - 3550 - driver_unregister(&ipmi_driver.driver); 3551 3565 } 3552 3566 module_exit(cleanup_ipmi_si); 3553 3567
+57 -92
drivers/char/xilinx_hwicap/xilinx_hwicap.c
··· 714 714 return 0; /* success */ 715 715 } 716 716 717 + #ifdef CONFIG_OF 718 + static int __devinit hwicap_of_probe(struct platform_device *op) 719 + { 720 + struct resource res; 721 + const unsigned int *id; 722 + const char *family; 723 + int rc; 724 + const struct hwicap_driver_config *config = op->dev.of_match->data; 725 + const struct config_registers *regs; 726 + 727 + 728 + rc = of_address_to_resource(op->dev.of_node, 0, &res); 729 + if (rc) { 730 + dev_err(&op->dev, "invalid address\n"); 731 + return rc; 732 + } 733 + 734 + id = of_get_property(op->dev.of_node, "port-number", NULL); 735 + 736 + /* It's most likely that we're using V4, if the family is not 737 + specified */ 738 + regs = &v4_config_registers; 739 + family = of_get_property(op->dev.of_node, "xlnx,family", NULL); 740 + 741 + if (family) { 742 + if (!strcmp(family, "virtex2p")) { 743 + regs = &v2_config_registers; 744 + } else if (!strcmp(family, "virtex4")) { 745 + regs = &v4_config_registers; 746 + } else if (!strcmp(family, "virtex5")) { 747 + regs = &v5_config_registers; 748 + } 749 + } 750 + return hwicap_setup(&op->dev, id ? *id : -1, &res, config, 751 + regs); 752 + } 753 + #else 754 + static inline int hwicap_of_probe(struct platform_device *op) 755 + { 756 + return -EINVAL; 757 + } 758 + #endif /* CONFIG_OF */ 759 + 717 760 static int __devinit hwicap_drv_probe(struct platform_device *pdev) 718 761 { 719 762 struct resource *res; 720 763 const struct config_registers *regs; 721 764 const char *family; 765 + 766 + if (pdev->dev.of_match) 767 + return hwicap_of_probe(pdev); 722 768 723 769 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 724 770 if (!res) ··· 794 748 return hwicap_remove(&pdev->dev); 795 749 } 796 750 797 - static struct platform_driver hwicap_platform_driver = { 798 - .probe = hwicap_drv_probe, 799 - .remove = hwicap_drv_remove, 800 - .driver = { 801 - .owner = THIS_MODULE, 802 - .name = DRIVER_NAME, 803 - }, 804 - }; 805 - 806 - /* --------------------------------------------------------------------- 807 - * OF bus binding 808 - */ 809 - 810 - #if defined(CONFIG_OF) 811 - static int __devinit 812 - hwicap_of_probe(struct platform_device *op, const struct of_device_id *match) 813 - { 814 - struct resource res; 815 - const unsigned int *id; 816 - const char *family; 817 - int rc; 818 - const struct hwicap_driver_config *config = match->data; 819 - const struct config_registers *regs; 820 - 821 - dev_dbg(&op->dev, "hwicap_of_probe(%p, %p)\n", op, match); 822 - 823 - rc = of_address_to_resource(op->dev.of_node, 0, &res); 824 - if (rc) { 825 - dev_err(&op->dev, "invalid address\n"); 826 - return rc; 827 - } 828 - 829 - id = of_get_property(op->dev.of_node, "port-number", NULL); 830 - 831 - /* It's most likely that we're using V4, if the family is not 832 - specified */ 833 - regs = &v4_config_registers; 834 - family = of_get_property(op->dev.of_node, "xlnx,family", NULL); 835 - 836 - if (family) { 837 - if (!strcmp(family, "virtex2p")) { 838 - regs = &v2_config_registers; 839 - } else if (!strcmp(family, "virtex4")) { 840 - regs = &v4_config_registers; 841 - } else if (!strcmp(family, "virtex5")) { 842 - regs = &v5_config_registers; 843 - } 844 - } 845 - return hwicap_setup(&op->dev, id ? *id : -1, &res, config, 846 - regs); 847 - } 848 - 849 - static int __devexit hwicap_of_remove(struct platform_device *op) 850 - { 851 - return hwicap_remove(&op->dev); 852 - } 853 - 854 - /* Match table for of_platform binding */ 751 + #ifdef CONFIG_OF 752 + /* Match table for device tree binding */ 855 753 static const struct of_device_id __devinitconst hwicap_of_match[] = { 856 754 { .compatible = "xlnx,opb-hwicap-1.00.b", .data = &buffer_icap_config}, 857 755 { .compatible = "xlnx,xps-hwicap-1.00.a", .data = &fifo_icap_config}, 858 756 {}, 859 757 }; 860 758 MODULE_DEVICE_TABLE(of, hwicap_of_match); 759 + #else 760 + #define hwicap_of_match NULL 761 + #endif 861 762 862 - static struct of_platform_driver hwicap_of_driver = { 863 - .probe = hwicap_of_probe, 864 - .remove = __devexit_p(hwicap_of_remove), 763 + static struct platform_driver hwicap_platform_driver = { 764 + .probe = hwicap_drv_probe, 765 + .remove = hwicap_drv_remove, 865 766 .driver = { 866 - .name = DRIVER_NAME, 867 767 .owner = THIS_MODULE, 768 + .name = DRIVER_NAME, 868 769 .of_match_table = hwicap_of_match, 869 770 }, 870 771 }; 871 - 872 - /* Registration helpers to keep the number of #ifdefs to a minimum */ 873 - static inline int __init hwicap_of_register(void) 874 - { 875 - pr_debug("hwicap: calling of_register_platform_driver()\n"); 876 - return of_register_platform_driver(&hwicap_of_driver); 877 - } 878 - 879 - static inline void __exit hwicap_of_unregister(void) 880 - { 881 - of_unregister_platform_driver(&hwicap_of_driver); 882 - } 883 - #else /* CONFIG_OF */ 884 - /* CONFIG_OF not enabled; do nothing helpers */ 885 - static inline int __init hwicap_of_register(void) { return 0; } 886 - static inline void __exit hwicap_of_unregister(void) { } 887 - #endif /* CONFIG_OF */ 888 772 889 773 static int __init hwicap_module_init(void) 890 774 { ··· 832 856 return retval; 833 857 834 858 retval = platform_driver_register(&hwicap_platform_driver); 835 - 836 859 if (retval) 837 - goto failed1; 838 - 839 - retval = hwicap_of_register(); 840 - 841 - if (retval) 842 - goto failed2; 860 + goto failed; 843 861 844 862 return retval; 845 863 846 - failed2: 847 - platform_driver_unregister(&hwicap_platform_driver); 848 - 849 - failed1: 864 + failed: 850 865 unregister_chrdev_region(devt, HWICAP_DEVICES); 851 866 852 867 return retval; ··· 850 883 class_destroy(icap_class); 851 884 852 885 platform_driver_unregister(&hwicap_platform_driver); 853 - 854 - hwicap_of_unregister(); 855 886 856 887 unregister_chrdev_region(devt, HWICAP_DEVICES); 857 888 }
+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);
+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/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
+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);
+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);
+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);
+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);
+13 -2
drivers/input/serio/altera_ps2.c
··· 19 19 #include <linux/platform_device.h> 20 20 #include <linux/io.h> 21 21 #include <linux/slab.h> 22 + #include <linux/of.h> 22 23 23 24 #define DRV_NAME "altera_ps2" 24 25 ··· 174 173 return 0; 175 174 } 176 175 176 + #ifdef CONFIG_OF 177 + static const struct of_device_id altera_ps2_match[] = { 178 + { .compatible = "ALTR,ps2-1.0", }, 179 + {}, 180 + }; 181 + MODULE_DEVICE_TABLE(of, altera_ps2_match); 182 + #else /* CONFIG_OF */ 183 + #define altera_ps2_match NULL 184 + #endif /* CONFIG_OF */ 185 + 177 186 /* 178 187 * Our device driver structure 179 188 */ ··· 193 182 .driver = { 194 183 .name = DRV_NAME, 195 184 .owner = THIS_MODULE, 185 + .of_match_table = altera_ps2_match, 196 186 }, 197 187 }; 198 188 ··· 201 189 { 202 190 return platform_driver_register(&altera_ps2_driver); 203 191 } 192 + module_init(altera_ps2_init); 204 193 205 194 static void __exit altera_ps2_exit(void) 206 195 { 207 196 platform_driver_unregister(&altera_ps2_driver); 208 197 } 209 - 210 - module_init(altera_ps2_init); 211 198 module_exit(altera_ps2_exit); 212 199 213 200 MODULE_DESCRIPTION("Altera University Program PS2 controller driver");
+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 -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);
+93 -133
drivers/leds/leds-gpio.c
··· 14 14 #include <linux/init.h> 15 15 #include <linux/platform_device.h> 16 16 #include <linux/leds.h> 17 + #include <linux/of_platform.h> 18 + #include <linux/of_gpio.h> 17 19 #include <linux/slab.h> 18 20 #include <linux/workqueue.h> 19 21 ··· 153 151 gpio_free(led->gpio); 154 152 } 155 153 156 - #ifdef CONFIG_LEDS_GPIO_PLATFORM 157 - static int __devinit gpio_led_probe(struct platform_device *pdev) 158 - { 159 - struct gpio_led_platform_data *pdata = pdev->dev.platform_data; 160 - struct gpio_led_data *leds_data; 161 - int i, ret = 0; 162 - 163 - if (!pdata) 164 - return -EBUSY; 165 - 166 - leds_data = kzalloc(sizeof(struct gpio_led_data) * pdata->num_leds, 167 - GFP_KERNEL); 168 - if (!leds_data) 169 - return -ENOMEM; 170 - 171 - for (i = 0; i < pdata->num_leds; i++) { 172 - ret = create_gpio_led(&pdata->leds[i], &leds_data[i], 173 - &pdev->dev, pdata->gpio_blink_set); 174 - if (ret < 0) 175 - goto err; 176 - } 177 - 178 - platform_set_drvdata(pdev, leds_data); 179 - 180 - return 0; 181 - 182 - err: 183 - for (i = i - 1; i >= 0; i--) 184 - delete_gpio_led(&leds_data[i]); 185 - 186 - kfree(leds_data); 187 - 188 - return ret; 189 - } 190 - 191 - static int __devexit gpio_led_remove(struct platform_device *pdev) 192 - { 193 - int i; 194 - struct gpio_led_platform_data *pdata = pdev->dev.platform_data; 195 - struct gpio_led_data *leds_data; 196 - 197 - leds_data = platform_get_drvdata(pdev); 198 - 199 - for (i = 0; i < pdata->num_leds; i++) 200 - delete_gpio_led(&leds_data[i]); 201 - 202 - kfree(leds_data); 203 - 204 - return 0; 205 - } 206 - 207 - static struct platform_driver gpio_led_driver = { 208 - .probe = gpio_led_probe, 209 - .remove = __devexit_p(gpio_led_remove), 210 - .driver = { 211 - .name = "leds-gpio", 212 - .owner = THIS_MODULE, 213 - }, 154 + struct gpio_leds_priv { 155 + int num_leds; 156 + struct gpio_led_data leds[]; 214 157 }; 215 158 216 - MODULE_ALIAS("platform:leds-gpio"); 217 - #endif /* CONFIG_LEDS_GPIO_PLATFORM */ 159 + static inline int sizeof_gpio_leds_priv(int num_leds) 160 + { 161 + return sizeof(struct gpio_leds_priv) + 162 + (sizeof(struct gpio_led_data) * num_leds); 163 + } 218 164 219 165 /* Code to create from OpenFirmware platform devices */ 220 166 #ifdef CONFIG_LEDS_GPIO_OF 221 - #include <linux/of_platform.h> 222 - #include <linux/of_gpio.h> 223 - 224 - struct gpio_led_of_platform_data { 225 - int num_leds; 226 - struct gpio_led_data led_data[]; 227 - }; 228 - 229 - static int __devinit of_gpio_leds_probe(struct platform_device *ofdev, 230 - const struct of_device_id *match) 167 + static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct platform_device *pdev) 231 168 { 232 - struct device_node *np = ofdev->dev.of_node, *child; 233 - struct gpio_led_of_platform_data *pdata; 169 + struct device_node *np = pdev->dev.of_node, *child; 170 + struct gpio_leds_priv *priv; 234 171 int count = 0, ret; 235 172 236 - /* count LEDs defined by this device, so we know how much to allocate */ 173 + /* count LEDs in this device, so we know how much to allocate */ 237 174 for_each_child_of_node(np, child) 238 175 count++; 239 176 if (!count) 240 - return 0; /* or ENODEV? */ 177 + return NULL; 241 178 242 - pdata = kzalloc(sizeof(*pdata) + sizeof(struct gpio_led_data) * count, 243 - GFP_KERNEL); 244 - if (!pdata) 245 - return -ENOMEM; 179 + priv = kzalloc(sizeof_gpio_leds_priv(count), GFP_KERNEL); 180 + if (!priv) 181 + return NULL; 246 182 247 183 for_each_child_of_node(np, child) { 248 184 struct gpio_led led = {}; ··· 196 256 if (state) { 197 257 if (!strcmp(state, "keep")) 198 258 led.default_state = LEDS_GPIO_DEFSTATE_KEEP; 199 - else if(!strcmp(state, "on")) 259 + else if (!strcmp(state, "on")) 200 260 led.default_state = LEDS_GPIO_DEFSTATE_ON; 201 261 else 202 262 led.default_state = LEDS_GPIO_DEFSTATE_OFF; 203 263 } 204 264 205 - ret = create_gpio_led(&led, &pdata->led_data[pdata->num_leds++], 206 - &ofdev->dev, NULL); 265 + ret = create_gpio_led(&led, &priv->leds[priv->num_leds++], 266 + &pdev->dev, NULL); 207 267 if (ret < 0) { 208 268 of_node_put(child); 209 269 goto err; 210 270 } 211 271 } 212 272 213 - dev_set_drvdata(&ofdev->dev, pdata); 214 - 215 - return 0; 273 + return priv; 216 274 217 275 err: 218 - for (count = pdata->num_leds - 2; count >= 0; count--) 219 - delete_gpio_led(&pdata->led_data[count]); 220 - 221 - kfree(pdata); 222 - 223 - return ret; 224 - } 225 - 226 - static int __devexit of_gpio_leds_remove(struct platform_device *ofdev) 227 - { 228 - struct gpio_led_of_platform_data *pdata = dev_get_drvdata(&ofdev->dev); 229 - int i; 230 - 231 - for (i = 0; i < pdata->num_leds; i++) 232 - delete_gpio_led(&pdata->led_data[i]); 233 - 234 - kfree(pdata); 235 - 236 - dev_set_drvdata(&ofdev->dev, NULL); 237 - 238 - return 0; 276 + for (count = priv->num_leds - 2; count >= 0; count--) 277 + delete_gpio_led(&priv->leds[count]); 278 + kfree(priv); 279 + return NULL; 239 280 } 240 281 241 282 static const struct of_device_id of_gpio_leds_match[] = { 242 283 { .compatible = "gpio-leds", }, 243 284 {}, 244 285 }; 286 + #else 287 + static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct platform_device *pdev) 288 + { 289 + return NULL; 290 + } 291 + #define of_gpio_leds_match NULL 292 + #endif 245 293 246 - static struct of_platform_driver of_gpio_leds_driver = { 247 - .driver = { 248 - .name = "of_gpio_leds", 249 - .owner = THIS_MODULE, 294 + 295 + static int __devinit gpio_led_probe(struct platform_device *pdev) 296 + { 297 + struct gpio_led_platform_data *pdata = pdev->dev.platform_data; 298 + struct gpio_leds_priv *priv; 299 + int i, ret = 0; 300 + 301 + if (pdata && pdata->num_leds) { 302 + priv = kzalloc(sizeof_gpio_leds_priv(pdata->num_leds), 303 + GFP_KERNEL); 304 + if (!priv) 305 + return -ENOMEM; 306 + 307 + priv->num_leds = pdata->num_leds; 308 + for (i = 0; i < priv->num_leds; i++) { 309 + ret = create_gpio_led(&pdata->leds[i], 310 + &priv->leds[i], 311 + &pdev->dev, pdata->gpio_blink_set); 312 + if (ret < 0) { 313 + /* On failure: unwind the led creations */ 314 + for (i = i - 1; i >= 0; i--) 315 + delete_gpio_led(&priv->leds[i]); 316 + kfree(priv); 317 + return ret; 318 + } 319 + } 320 + } else { 321 + priv = gpio_leds_create_of(pdev); 322 + if (!priv) 323 + return -ENODEV; 324 + } 325 + 326 + platform_set_drvdata(pdev, priv); 327 + 328 + return 0; 329 + } 330 + 331 + static int __devexit gpio_led_remove(struct platform_device *pdev) 332 + { 333 + struct gpio_leds_priv *priv = dev_get_drvdata(&pdev->dev); 334 + int i; 335 + 336 + for (i = 0; i < priv->num_leds; i++) 337 + delete_gpio_led(&priv->leds[i]); 338 + 339 + dev_set_drvdata(&pdev->dev, NULL); 340 + kfree(priv); 341 + 342 + return 0; 343 + } 344 + 345 + static struct platform_driver gpio_led_driver = { 346 + .probe = gpio_led_probe, 347 + .remove = __devexit_p(gpio_led_remove), 348 + .driver = { 349 + .name = "leds-gpio", 350 + .owner = THIS_MODULE, 250 351 .of_match_table = of_gpio_leds_match, 251 352 }, 252 - .probe = of_gpio_leds_probe, 253 - .remove = __devexit_p(of_gpio_leds_remove), 254 353 }; 255 - #endif 354 + 355 + MODULE_ALIAS("platform:leds-gpio"); 256 356 257 357 static int __init gpio_led_init(void) 258 358 { 259 - int ret = 0; 260 - 261 - #ifdef CONFIG_LEDS_GPIO_PLATFORM 262 - ret = platform_driver_register(&gpio_led_driver); 263 - if (ret) 264 - return ret; 265 - #endif 266 - #ifdef CONFIG_LEDS_GPIO_OF 267 - ret = of_register_platform_driver(&of_gpio_leds_driver); 268 - #endif 269 - #ifdef CONFIG_LEDS_GPIO_PLATFORM 270 - if (ret) 271 - platform_driver_unregister(&gpio_led_driver); 272 - #endif 273 - 274 - return ret; 359 + return platform_driver_register(&gpio_led_driver); 275 360 } 276 361 277 362 static void __exit gpio_led_exit(void) 278 363 { 279 - #ifdef CONFIG_LEDS_GPIO_PLATFORM 280 364 platform_driver_unregister(&gpio_led_driver); 281 - #endif 282 - #ifdef CONFIG_LEDS_GPIO_OF 283 - of_unregister_platform_driver(&of_gpio_leds_driver); 284 - #endif 285 365 } 286 366 287 367 module_init(gpio_led_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 );
+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);
+9 -6
drivers/net/can/mscan/mpc5xxx_can.c
··· 247 247 } 248 248 #endif /* CONFIG_PPC_MPC512x */ 249 249 250 - static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev, 251 - const struct of_device_id *id) 250 + static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev) 252 251 { 253 - struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data; 252 + struct mpc5xxx_can_data *data; 254 253 struct device_node *np = ofdev->dev.of_node; 255 254 struct net_device *dev; 256 255 struct mscan_priv *priv; ··· 257 258 const char *clock_name = NULL; 258 259 int irq, mscan_clksrc = 0; 259 260 int err = -ENOMEM; 261 + 262 + if (!ofdev->dev.of_match) 263 + return -EINVAL; 264 + data = (struct mpc5xxx_can_data *)of_dev->dev.of_match->data; 260 265 261 266 base = of_iomap(np, 0); 262 267 if (!base) { ··· 394 391 {}, 395 392 }; 396 393 397 - static struct of_platform_driver mpc5xxx_can_driver = { 394 + static struct platform_driver mpc5xxx_can_driver = { 398 395 .driver = { 399 396 .name = "mpc5xxx_can", 400 397 .owner = THIS_MODULE, ··· 410 407 411 408 static int __init mpc5xxx_can_init(void) 412 409 { 413 - return of_register_platform_driver(&mpc5xxx_can_driver); 410 + return platform_driver_register(&mpc5xxx_can_driver); 414 411 } 415 412 module_init(mpc5xxx_can_init); 416 413 417 414 static void __exit mpc5xxx_can_exit(void) 418 415 { 419 - return of_unregister_platform_driver(&mpc5xxx_can_driver); 416 + platform_driver_unregister(&mpc5xxx_can_driver); 420 417 }; 421 418 module_exit(mpc5xxx_can_exit); 422 419
+4 -5
drivers/net/can/sja1000/sja1000_of_platform.c
··· 87 87 return 0; 88 88 } 89 89 90 - static int __devinit sja1000_ofp_probe(struct platform_device *ofdev, 91 - const struct of_device_id *id) 90 + static int __devinit sja1000_ofp_probe(struct platform_device *ofdev) 92 91 { 93 92 struct device_node *np = ofdev->dev.of_node; 94 93 struct net_device *dev; ··· 209 210 }; 210 211 MODULE_DEVICE_TABLE(of, sja1000_ofp_table); 211 212 212 - static struct of_platform_driver sja1000_ofp_driver = { 213 + static struct platform_driver sja1000_ofp_driver = { 213 214 .driver = { 214 215 .owner = THIS_MODULE, 215 216 .name = DRV_NAME, ··· 221 222 222 223 static int __init sja1000_ofp_init(void) 223 224 { 224 - return of_register_platform_driver(&sja1000_ofp_driver); 225 + return platform_driver_register(&sja1000_ofp_driver); 225 226 } 226 227 module_init(sja1000_ofp_init); 227 228 228 229 static void __exit sja1000_ofp_exit(void) 229 230 { 230 - return of_unregister_platform_driver(&sja1000_ofp_driver); 231 + return platform_driver_unregister(&sja1000_ofp_driver); 231 232 }; 232 233 module_exit(sja1000_ofp_exit);
+6 -7
drivers/net/fec_mpc52xx.c
··· 840 840 /* OF Driver */ 841 841 /* ======================================================================== */ 842 842 843 - static int __devinit 844 - mpc52xx_fec_probe(struct platform_device *op, const struct of_device_id *match) 843 + static int __devinit mpc52xx_fec_probe(struct platform_device *op) 845 844 { 846 845 int rv; 847 846 struct net_device *ndev; ··· 1048 1049 1049 1050 MODULE_DEVICE_TABLE(of, mpc52xx_fec_match); 1050 1051 1051 - static struct of_platform_driver mpc52xx_fec_driver = { 1052 + static struct platform_driver mpc52xx_fec_driver = { 1052 1053 .driver = { 1053 1054 .name = DRIVER_NAME, 1054 1055 .owner = THIS_MODULE, ··· 1072 1073 { 1073 1074 #ifdef CONFIG_FEC_MPC52xx_MDIO 1074 1075 int ret; 1075 - ret = of_register_platform_driver(&mpc52xx_fec_mdio_driver); 1076 + ret = platform_driver_register(&mpc52xx_fec_mdio_driver); 1076 1077 if (ret) { 1077 1078 printk(KERN_ERR DRIVER_NAME ": failed to register mdio driver\n"); 1078 1079 return ret; 1079 1080 } 1080 1081 #endif 1081 - return of_register_platform_driver(&mpc52xx_fec_driver); 1082 + return platform_driver_register(&mpc52xx_fec_driver); 1082 1083 } 1083 1084 1084 1085 static void __exit 1085 1086 mpc52xx_fec_exit(void) 1086 1087 { 1087 - of_unregister_platform_driver(&mpc52xx_fec_driver); 1088 + platform_driver_unregister(&mpc52xx_fec_driver); 1088 1089 #ifdef CONFIG_FEC_MPC52xx_MDIO 1089 - of_unregister_platform_driver(&mpc52xx_fec_mdio_driver); 1090 + platform_driver_unregister(&mpc52xx_fec_mdio_driver); 1090 1091 #endif 1091 1092 } 1092 1093
+1 -1
drivers/net/fec_mpc52xx.h
··· 289 289 #define FEC_XMIT_FSM_ENABLE_CRC 0x01000000 290 290 291 291 292 - extern struct of_platform_driver mpc52xx_fec_mdio_driver; 292 + extern struct platform_driver mpc52xx_fec_mdio_driver; 293 293 294 294 #endif /* __DRIVERS_NET_MPC52XX_FEC_H__ */
+2 -3
drivers/net/fec_mpc52xx_phy.c
··· 61 61 data | FEC_MII_WRITE_FRAME); 62 62 } 63 63 64 - static int mpc52xx_fec_mdio_probe(struct platform_device *of, 65 - const struct of_device_id *match) 64 + static int mpc52xx_fec_mdio_probe(struct platform_device *of) 66 65 { 67 66 struct device *dev = &of->dev; 68 67 struct device_node *np = of->dev.of_node; ··· 144 145 }; 145 146 MODULE_DEVICE_TABLE(of, mpc52xx_fec_mdio_match); 146 147 147 - struct of_platform_driver mpc52xx_fec_mdio_driver = { 148 + struct platform_driver mpc52xx_fec_mdio_driver = { 148 149 .driver = { 149 150 .name = "mpc5200b-fec-phy", 150 151 .owner = THIS_MODULE,
+9 -7
drivers/net/fs_enet/fs_enet-main.c
··· 998 998 #endif 999 999 }; 1000 1000 1001 - static int __devinit fs_enet_probe(struct platform_device *ofdev, 1002 - const struct of_device_id *match) 1001 + static int __devinit fs_enet_probe(struct platform_device *ofdev) 1003 1002 { 1004 1003 struct net_device *ndev; 1005 1004 struct fs_enet_private *fep; ··· 1007 1008 const u8 *mac_addr; 1008 1009 int privsize, len, ret = -ENODEV; 1009 1010 1011 + if (!ofdev->dev.of_match) 1012 + return -EINVAL; 1013 + 1010 1014 fpi = kzalloc(sizeof(*fpi), GFP_KERNEL); 1011 1015 if (!fpi) 1012 1016 return -ENOMEM; 1013 1017 1014 - if (!IS_FEC(match)) { 1018 + if (!IS_FEC(ofdev->dev.of_match)) { 1015 1019 data = of_get_property(ofdev->dev.of_node, "fsl,cpm-command", &len); 1016 1020 if (!data || len != 4) 1017 1021 goto out_free_fpi; ··· 1049 1047 fep->dev = &ofdev->dev; 1050 1048 fep->ndev = ndev; 1051 1049 fep->fpi = fpi; 1052 - fep->ops = match->data; 1050 + fep->ops = ofdev->dev.of_match->data; 1053 1051 1054 1052 ret = fep->ops->setup_data(ndev); 1055 1053 if (ret) ··· 1158 1156 }; 1159 1157 MODULE_DEVICE_TABLE(of, fs_enet_match); 1160 1158 1161 - static struct of_platform_driver fs_enet_driver = { 1159 + static struct platform_driver fs_enet_driver = { 1162 1160 .driver = { 1163 1161 .owner = THIS_MODULE, 1164 1162 .name = "fs_enet", ··· 1170 1168 1171 1169 static int __init fs_init(void) 1172 1170 { 1173 - return of_register_platform_driver(&fs_enet_driver); 1171 + return platform_driver_register(&fs_enet_driver); 1174 1172 } 1175 1173 1176 1174 static void __exit fs_cleanup(void) 1177 1175 { 1178 - of_unregister_platform_driver(&fs_enet_driver); 1176 + platform_driver_unregister(&fs_enet_driver); 1179 1177 } 1180 1178 1181 1179 #ifdef CONFIG_NET_POLL_CONTROLLER
+4 -5
drivers/net/fs_enet/mii-bitbang.c
··· 150 150 return 0; 151 151 } 152 152 153 - static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev, 154 - const struct of_device_id *match) 153 + static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev) 155 154 { 156 155 struct mii_bus *new_bus; 157 156 struct bb_info *bitbang; ··· 222 223 }; 223 224 MODULE_DEVICE_TABLE(of, fs_enet_mdio_bb_match); 224 225 225 - static struct of_platform_driver fs_enet_bb_mdio_driver = { 226 + static struct platform_driver fs_enet_bb_mdio_driver = { 226 227 .driver = { 227 228 .name = "fsl-bb-mdio", 228 229 .owner = THIS_MODULE, ··· 234 235 235 236 static int fs_enet_mdio_bb_init(void) 236 237 { 237 - return of_register_platform_driver(&fs_enet_bb_mdio_driver); 238 + return platform_driver_register(&fs_enet_bb_mdio_driver); 238 239 } 239 240 240 241 static void fs_enet_mdio_bb_exit(void) 241 242 { 242 - of_unregister_platform_driver(&fs_enet_bb_mdio_driver); 243 + platform_driver_unregister(&fs_enet_bb_mdio_driver); 243 244 } 244 245 245 246 module_init(fs_enet_mdio_bb_init);
+9 -6
drivers/net/fs_enet/mii-fec.c
··· 101 101 return 0; 102 102 } 103 103 104 - static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev, 105 - const struct of_device_id *match) 104 + static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev) 106 105 { 107 106 struct resource res; 108 107 struct mii_bus *new_bus; 109 108 struct fec_info *fec; 110 - int (*get_bus_freq)(struct device_node *) = match->data; 109 + int (*get_bus_freq)(struct device_node *); 111 110 int ret = -ENOMEM, clock, speed; 111 + 112 + if (!ofdev->dev.of_match) 113 + return -EINVAL; 114 + get_bus_freq = ofdev->dev.of_match->data; 112 115 113 116 new_bus = mdiobus_alloc(); 114 117 if (!new_bus) ··· 224 221 }; 225 222 MODULE_DEVICE_TABLE(of, fs_enet_mdio_fec_match); 226 223 227 - static struct of_platform_driver fs_enet_fec_mdio_driver = { 224 + static struct platform_driver fs_enet_fec_mdio_driver = { 228 225 .driver = { 229 226 .name = "fsl-fec-mdio", 230 227 .owner = THIS_MODULE, ··· 236 233 237 234 static int fs_enet_mdio_fec_init(void) 238 235 { 239 - return of_register_platform_driver(&fs_enet_fec_mdio_driver); 236 + return platform_driver_register(&fs_enet_fec_mdio_driver); 240 237 } 241 238 242 239 static void fs_enet_mdio_fec_exit(void) 243 240 { 244 - of_unregister_platform_driver(&fs_enet_fec_mdio_driver); 241 + platform_driver_unregister(&fs_enet_fec_mdio_driver); 245 242 } 246 243 247 244 module_init(fs_enet_mdio_fec_init);
+4 -5
drivers/net/fsl_pq_mdio.c
··· 265 265 #endif 266 266 267 267 268 - static int fsl_pq_mdio_probe(struct platform_device *ofdev, 269 - const struct of_device_id *match) 268 + static int fsl_pq_mdio_probe(struct platform_device *ofdev) 270 269 { 271 270 struct device_node *np = ofdev->dev.of_node; 272 271 struct device_node *tbi; ··· 470 471 }; 471 472 MODULE_DEVICE_TABLE(of, fsl_pq_mdio_match); 472 473 473 - static struct of_platform_driver fsl_pq_mdio_driver = { 474 + static struct platform_driver fsl_pq_mdio_driver = { 474 475 .driver = { 475 476 .name = "fsl-pq_mdio", 476 477 .owner = THIS_MODULE, ··· 482 483 483 484 int __init fsl_pq_mdio_init(void) 484 485 { 485 - return of_register_platform_driver(&fsl_pq_mdio_driver); 486 + return platform_driver_register(&fsl_pq_mdio_driver); 486 487 } 487 488 module_init(fsl_pq_mdio_init); 488 489 489 490 void fsl_pq_mdio_exit(void) 490 491 { 491 - of_unregister_platform_driver(&fsl_pq_mdio_driver); 492 + platform_driver_unregister(&fsl_pq_mdio_driver); 492 493 } 493 494 module_exit(fsl_pq_mdio_exit); 494 495 MODULE_LICENSE("GPL");
+5 -7
drivers/net/gianfar.c
··· 123 123 static void adjust_link(struct net_device *dev); 124 124 static void init_registers(struct net_device *dev); 125 125 static int init_phy(struct net_device *dev); 126 - static int gfar_probe(struct platform_device *ofdev, 127 - const struct of_device_id *match); 126 + static int gfar_probe(struct platform_device *ofdev); 128 127 static int gfar_remove(struct platform_device *ofdev); 129 128 static void free_skb_resources(struct gfar_private *priv); 130 129 static void gfar_set_multi(struct net_device *dev); ··· 956 957 957 958 /* Set up the ethernet device structure, private data, 958 959 * and anything else we need before we start */ 959 - static int gfar_probe(struct platform_device *ofdev, 960 - const struct of_device_id *match) 960 + static int gfar_probe(struct platform_device *ofdev) 961 961 { 962 962 u32 tempval; 963 963 struct net_device *dev = NULL; ··· 3254 3256 MODULE_DEVICE_TABLE(of, gfar_match); 3255 3257 3256 3258 /* Structure for a device driver */ 3257 - static struct of_platform_driver gfar_driver = { 3259 + static struct platform_driver gfar_driver = { 3258 3260 .driver = { 3259 3261 .name = "fsl-gianfar", 3260 3262 .owner = THIS_MODULE, ··· 3267 3269 3268 3270 static int __init gfar_init(void) 3269 3271 { 3270 - return of_register_platform_driver(&gfar_driver); 3272 + return platform_driver_register(&gfar_driver); 3271 3273 } 3272 3274 3273 3275 static void __exit gfar_exit(void) 3274 3276 { 3275 - of_unregister_platform_driver(&gfar_driver); 3277 + platform_driver_unregister(&gfar_driver); 3276 3278 } 3277 3279 3278 3280 module_init(gfar_init);
+4 -4
drivers/net/greth.c
··· 1411 1411 } 1412 1412 1413 1413 /* Initialize the GRETH MAC */ 1414 - static int __devinit greth_of_probe(struct platform_device *ofdev, const struct of_device_id *match) 1414 + static int __devinit greth_of_probe(struct platform_device *ofdev) 1415 1415 { 1416 1416 struct net_device *dev; 1417 1417 struct greth_private *greth; ··· 1646 1646 1647 1647 MODULE_DEVICE_TABLE(of, greth_of_match); 1648 1648 1649 - static struct of_platform_driver greth_of_driver = { 1649 + static struct platform_driver greth_of_driver = { 1650 1650 .driver = { 1651 1651 .name = "grlib-greth", 1652 1652 .owner = THIS_MODULE, ··· 1658 1658 1659 1659 static int __init greth_init(void) 1660 1660 { 1661 - return of_register_platform_driver(&greth_of_driver); 1661 + return platform_driver_register(&greth_of_driver); 1662 1662 } 1663 1663 1664 1664 static void __exit greth_cleanup(void) 1665 1665 { 1666 - of_unregister_platform_driver(&greth_of_driver); 1666 + platform_driver_unregister(&greth_of_driver); 1667 1667 } 1668 1668 1669 1669 module_init(greth_init);
+4 -5
drivers/net/ibm_newemac/core.c
··· 2719 2719 .ndo_change_mtu = emac_change_mtu, 2720 2720 }; 2721 2721 2722 - static int __devinit emac_probe(struct platform_device *ofdev, 2723 - const struct of_device_id *match) 2722 + static int __devinit emac_probe(struct platform_device *ofdev) 2724 2723 { 2725 2724 struct net_device *ndev; 2726 2725 struct emac_instance *dev; ··· 2993 2994 }; 2994 2995 MODULE_DEVICE_TABLE(of, emac_match); 2995 2996 2996 - static struct of_platform_driver emac_driver = { 2997 + static struct platform_driver emac_driver = { 2997 2998 .driver = { 2998 2999 .name = "emac", 2999 3000 .owner = THIS_MODULE, ··· 3068 3069 rc = tah_init(); 3069 3070 if (rc) 3070 3071 goto err_rgmii; 3071 - rc = of_register_platform_driver(&emac_driver); 3072 + rc = platform_driver_register(&emac_driver); 3072 3073 if (rc) 3073 3074 goto err_tah; 3074 3075 ··· 3090 3091 { 3091 3092 int i; 3092 3093 3093 - of_unregister_platform_driver(&emac_driver); 3094 + platform_driver_unregister(&emac_driver); 3094 3095 3095 3096 tah_exit(); 3096 3097 rgmii_exit();
+4 -5
drivers/net/ibm_newemac/mal.c
··· 517 517 return regs + 1; 518 518 } 519 519 520 - static int __devinit mal_probe(struct platform_device *ofdev, 521 - const struct of_device_id *match) 520 + static int __devinit mal_probe(struct platform_device *ofdev) 522 521 { 523 522 struct mal_instance *mal; 524 523 int err = 0, i, bd_size; ··· 788 789 {}, 789 790 }; 790 791 791 - static struct of_platform_driver mal_of_driver = { 792 + static struct platform_driver mal_of_driver = { 792 793 .driver = { 793 794 .name = "mcmal", 794 795 .owner = THIS_MODULE, ··· 800 801 801 802 int __init mal_init(void) 802 803 { 803 - return of_register_platform_driver(&mal_of_driver); 804 + return platform_driver_register(&mal_of_driver); 804 805 } 805 806 806 807 void mal_exit(void) 807 808 { 808 - of_unregister_platform_driver(&mal_of_driver); 809 + platform_driver_unregister(&mal_of_driver); 809 810 }
+4 -5
drivers/net/ibm_newemac/rgmii.c
··· 228 228 } 229 229 230 230 231 - static int __devinit rgmii_probe(struct platform_device *ofdev, 232 - const struct of_device_id *match) 231 + static int __devinit rgmii_probe(struct platform_device *ofdev) 233 232 { 234 233 struct device_node *np = ofdev->dev.of_node; 235 234 struct rgmii_instance *dev; ··· 317 318 {}, 318 319 }; 319 320 320 - static struct of_platform_driver rgmii_driver = { 321 + static struct platform_driver rgmii_driver = { 321 322 .driver = { 322 323 .name = "emac-rgmii", 323 324 .owner = THIS_MODULE, ··· 329 330 330 331 int __init rgmii_init(void) 331 332 { 332 - return of_register_platform_driver(&rgmii_driver); 333 + return platform_driver_register(&rgmii_driver); 333 334 } 334 335 335 336 void rgmii_exit(void) 336 337 { 337 - of_unregister_platform_driver(&rgmii_driver); 338 + platform_driver_unregister(&rgmii_driver); 338 339 }
+4 -5
drivers/net/ibm_newemac/tah.c
··· 87 87 return regs + 1; 88 88 } 89 89 90 - static int __devinit tah_probe(struct platform_device *ofdev, 91 - const struct of_device_id *match) 90 + static int __devinit tah_probe(struct platform_device *ofdev) 92 91 { 93 92 struct device_node *np = ofdev->dev.of_node; 94 93 struct tah_instance *dev; ··· 164 165 {}, 165 166 }; 166 167 167 - static struct of_platform_driver tah_driver = { 168 + static struct platform_driver tah_driver = { 168 169 .driver = { 169 170 .name = "emac-tah", 170 171 .owner = THIS_MODULE, ··· 176 177 177 178 int __init tah_init(void) 178 179 { 179 - return of_register_platform_driver(&tah_driver); 180 + return platform_driver_register(&tah_driver); 180 181 } 181 182 182 183 void tah_exit(void) 183 184 { 184 - of_unregister_platform_driver(&tah_driver); 185 + platform_driver_unregister(&tah_driver); 185 186 }
+4 -5
drivers/net/ibm_newemac/zmii.c
··· 231 231 return regs + 1; 232 232 } 233 233 234 - static int __devinit zmii_probe(struct platform_device *ofdev, 235 - const struct of_device_id *match) 234 + static int __devinit zmii_probe(struct platform_device *ofdev) 236 235 { 237 236 struct device_node *np = ofdev->dev.of_node; 238 237 struct zmii_instance *dev; ··· 311 312 {}, 312 313 }; 313 314 314 - static struct of_platform_driver zmii_driver = { 315 + static struct platform_driver zmii_driver = { 315 316 .driver = { 316 317 .name = "emac-zmii", 317 318 .owner = THIS_MODULE, ··· 323 324 324 325 int __init zmii_init(void) 325 326 { 326 - return of_register_platform_driver(&zmii_driver); 327 + return platform_driver_register(&zmii_driver); 327 328 } 328 329 329 330 void zmii_exit(void) 330 331 { 331 - of_unregister_platform_driver(&zmii_driver); 332 + platform_driver_unregister(&zmii_driver); 332 333 }
+4 -5
drivers/net/ll_temac_main.c
··· 952 952 .attrs = temac_device_attrs, 953 953 }; 954 954 955 - static int __devinit 956 - temac_of_probe(struct platform_device *op, const struct of_device_id *match) 955 + static int __devinit temac_of_probe(struct platform_device *op) 957 956 { 958 957 struct device_node *np; 959 958 struct temac_local *lp; ··· 1122 1123 }; 1123 1124 MODULE_DEVICE_TABLE(of, temac_of_match); 1124 1125 1125 - static struct of_platform_driver temac_of_driver = { 1126 + static struct platform_driver temac_of_driver = { 1126 1127 .probe = temac_of_probe, 1127 1128 .remove = __devexit_p(temac_of_remove), 1128 1129 .driver = { ··· 1134 1135 1135 1136 static int __init temac_init(void) 1136 1137 { 1137 - return of_register_platform_driver(&temac_of_driver); 1138 + return platform_driver_register(&temac_of_driver); 1138 1139 } 1139 1140 module_init(temac_init); 1140 1141 1141 1142 static void __exit temac_exit(void) 1142 1143 { 1143 - of_unregister_platform_driver(&temac_of_driver); 1144 + platform_driver_unregister(&temac_of_driver); 1144 1145 } 1145 1146 module_exit(temac_exit); 1146 1147
+4 -4
drivers/net/myri_sbus.c
··· 926 926 .ndo_validate_addr = eth_validate_addr, 927 927 }; 928 928 929 - static int __devinit myri_sbus_probe(struct platform_device *op, const struct of_device_id *match) 929 + static int __devinit myri_sbus_probe(struct platform_device *op) 930 930 { 931 931 struct device_node *dp = op->dev.of_node; 932 932 static unsigned version_printed; ··· 1160 1160 1161 1161 MODULE_DEVICE_TABLE(of, myri_sbus_match); 1162 1162 1163 - static struct of_platform_driver myri_sbus_driver = { 1163 + static struct platform_driver myri_sbus_driver = { 1164 1164 .driver = { 1165 1165 .name = "myri", 1166 1166 .owner = THIS_MODULE, ··· 1172 1172 1173 1173 static int __init myri_sbus_init(void) 1174 1174 { 1175 - return of_register_platform_driver(&myri_sbus_driver); 1175 + return platform_driver_register(&myri_sbus_driver); 1176 1176 } 1177 1177 1178 1178 static void __exit myri_sbus_exit(void) 1179 1179 { 1180 - of_unregister_platform_driver(&myri_sbus_driver); 1180 + platform_driver_unregister(&myri_sbus_driver); 1181 1181 } 1182 1182 1183 1183 module_init(myri_sbus_init);
+5 -6
drivers/net/niu.c
··· 10062 10062 .unmap_single = niu_phys_unmap_single, 10063 10063 }; 10064 10064 10065 - static int __devinit niu_of_probe(struct platform_device *op, 10066 - const struct of_device_id *match) 10065 + static int __devinit niu_of_probe(struct platform_device *op) 10067 10066 { 10068 10067 union niu_parent_id parent_id; 10069 10068 struct net_device *dev; ··· 10222 10223 }; 10223 10224 MODULE_DEVICE_TABLE(of, niu_match); 10224 10225 10225 - static struct of_platform_driver niu_of_driver = { 10226 + static struct platform_driver niu_of_driver = { 10226 10227 .driver = { 10227 10228 .name = "niu", 10228 10229 .owner = THIS_MODULE, ··· 10243 10244 niu_debug = netif_msg_init(debug, NIU_MSG_DEFAULT); 10244 10245 10245 10246 #ifdef CONFIG_SPARC64 10246 - err = of_register_platform_driver(&niu_of_driver); 10247 + err = platform_driver_register(&niu_of_driver); 10247 10248 #endif 10248 10249 10249 10250 if (!err) { 10250 10251 err = pci_register_driver(&niu_pci_driver); 10251 10252 #ifdef CONFIG_SPARC64 10252 10253 if (err) 10253 - of_unregister_platform_driver(&niu_of_driver); 10254 + platform_driver_unregister(&niu_of_driver); 10254 10255 #endif 10255 10256 } 10256 10257 ··· 10261 10262 { 10262 10263 pci_unregister_driver(&niu_pci_driver); 10263 10264 #ifdef CONFIG_SPARC64 10264 - of_unregister_platform_driver(&niu_of_driver); 10265 + platform_driver_unregister(&niu_of_driver); 10265 10266 #endif 10266 10267 } 10267 10268
+4 -5
drivers/net/phy/mdio-gpio.c
··· 188 188 189 189 #ifdef CONFIG_OF_GPIO 190 190 191 - static int __devinit mdio_ofgpio_probe(struct platform_device *ofdev, 192 - const struct of_device_id *match) 191 + static int __devinit mdio_ofgpio_probe(struct platform_device *ofdev) 193 192 { 194 193 struct mdio_gpio_platform_data *pdata; 195 194 struct mii_bus *new_bus; ··· 239 240 }; 240 241 MODULE_DEVICE_TABLE(of, mdio_ofgpio_match); 241 242 242 - static struct of_platform_driver mdio_ofgpio_driver = { 243 + static struct platform_driver mdio_ofgpio_driver = { 243 244 .driver = { 244 245 .name = "mdio-gpio", 245 246 .owner = THIS_MODULE, ··· 251 252 252 253 static inline int __init mdio_ofgpio_init(void) 253 254 { 254 - return of_register_platform_driver(&mdio_ofgpio_driver); 255 + return platform_driver_register(&mdio_ofgpio_driver); 255 256 } 256 257 257 258 static inline void __exit mdio_ofgpio_exit(void) 258 259 { 259 - of_unregister_platform_driver(&mdio_ofgpio_driver); 260 + platform_driver_unregister(&mdio_ofgpio_driver); 260 261 } 261 262 #else 262 263 static inline int __init mdio_ofgpio_init(void) { return 0; }
+4 -5
drivers/net/sunbmac.c
··· 1242 1242 /* QEC can be the parent of either QuadEthernet or a BigMAC. We want 1243 1243 * the latter. 1244 1244 */ 1245 - static int __devinit bigmac_sbus_probe(struct platform_device *op, 1246 - const struct of_device_id *match) 1245 + static int __devinit bigmac_sbus_probe(struct platform_device *op) 1247 1246 { 1248 1247 struct device *parent = op->dev.parent; 1249 1248 struct platform_device *qec_op; ··· 1288 1289 1289 1290 MODULE_DEVICE_TABLE(of, bigmac_sbus_match); 1290 1291 1291 - static struct of_platform_driver bigmac_sbus_driver = { 1292 + static struct platform_driver bigmac_sbus_driver = { 1292 1293 .driver = { 1293 1294 .name = "sunbmac", 1294 1295 .owner = THIS_MODULE, ··· 1300 1301 1301 1302 static int __init bigmac_init(void) 1302 1303 { 1303 - return of_register_platform_driver(&bigmac_sbus_driver); 1304 + return platform_driver_register(&bigmac_sbus_driver); 1304 1305 } 1305 1306 1306 1307 static void __exit bigmac_exit(void) 1307 1308 { 1308 - of_unregister_platform_driver(&bigmac_sbus_driver); 1309 + platform_driver_unregister(&bigmac_sbus_driver); 1309 1310 } 1310 1311 1311 1312 module_init(bigmac_init);
+9 -5
drivers/net/sunhme.c
··· 3237 3237 #endif 3238 3238 3239 3239 #ifdef CONFIG_SBUS 3240 - static int __devinit hme_sbus_probe(struct platform_device *op, const struct of_device_id *match) 3240 + static int __devinit hme_sbus_probe(struct platform_device *op) 3241 3241 { 3242 3242 struct device_node *dp = op->dev.of_node; 3243 3243 const char *model = of_get_property(dp, "model", NULL); 3244 - int is_qfe = (match->data != NULL); 3244 + int is_qfe; 3245 + 3246 + if (!op->dev.of_match) 3247 + return -EINVAL; 3248 + is_qfe = (op->dev.of_match->data != NULL); 3245 3249 3246 3250 if (!is_qfe && model && !strcmp(model, "SUNW,sbus-qfe")) 3247 3251 is_qfe = 1; ··· 3296 3292 3297 3293 MODULE_DEVICE_TABLE(of, hme_sbus_match); 3298 3294 3299 - static struct of_platform_driver hme_sbus_driver = { 3295 + static struct platform_driver hme_sbus_driver = { 3300 3296 .driver = { 3301 3297 .name = "hme", 3302 3298 .owner = THIS_MODULE, ··· 3310 3306 { 3311 3307 int err; 3312 3308 3313 - err = of_register_platform_driver(&hme_sbus_driver); 3309 + err = platform_driver_register(&hme_sbus_driver); 3314 3310 if (!err) 3315 3311 err = quattro_sbus_register_irqs(); 3316 3312 ··· 3319 3315 3320 3316 static void happy_meal_sbus_exit(void) 3321 3317 { 3322 - of_unregister_platform_driver(&hme_sbus_driver); 3318 + platform_driver_unregister(&hme_sbus_driver); 3323 3319 quattro_sbus_free_irqs(); 3324 3320 3325 3321 while (qfe_sbus_list) {
+4 -4
drivers/net/sunlance.c
··· 1495 1495 return -ENODEV; 1496 1496 } 1497 1497 1498 - static int __devinit sunlance_sbus_probe(struct platform_device *op, const struct of_device_id *match) 1498 + static int __devinit sunlance_sbus_probe(struct platform_device *op) 1499 1499 { 1500 1500 struct platform_device *parent = to_platform_device(op->dev.parent); 1501 1501 struct device_node *parent_dp = parent->dev.of_node; ··· 1536 1536 1537 1537 MODULE_DEVICE_TABLE(of, sunlance_sbus_match); 1538 1538 1539 - static struct of_platform_driver sunlance_sbus_driver = { 1539 + static struct platform_driver sunlance_sbus_driver = { 1540 1540 .driver = { 1541 1541 .name = "sunlance", 1542 1542 .owner = THIS_MODULE, ··· 1550 1550 /* Find all the lance cards on the system and initialize them */ 1551 1551 static int __init sparc_lance_init(void) 1552 1552 { 1553 - return of_register_platform_driver(&sunlance_sbus_driver); 1553 + return platform_driver_register(&sunlance_sbus_driver); 1554 1554 } 1555 1555 1556 1556 static void __exit sparc_lance_exit(void) 1557 1557 { 1558 - of_unregister_platform_driver(&sunlance_sbus_driver); 1558 + platform_driver_unregister(&sunlance_sbus_driver); 1559 1559 } 1560 1560 1561 1561 module_init(sparc_lance_init);
+4 -4
drivers/net/sunqe.c
··· 941 941 return res; 942 942 } 943 943 944 - static int __devinit qec_sbus_probe(struct platform_device *op, const struct of_device_id *match) 944 + static int __devinit qec_sbus_probe(struct platform_device *op) 945 945 { 946 946 return qec_ether_init(op); 947 947 } ··· 976 976 977 977 MODULE_DEVICE_TABLE(of, qec_sbus_match); 978 978 979 - static struct of_platform_driver qec_sbus_driver = { 979 + static struct platform_driver qec_sbus_driver = { 980 980 .driver = { 981 981 .name = "qec", 982 982 .owner = THIS_MODULE, ··· 988 988 989 989 static int __init qec_init(void) 990 990 { 991 - return of_register_platform_driver(&qec_sbus_driver); 991 + return platform_driver_register(&qec_sbus_driver); 992 992 } 993 993 994 994 static void __exit qec_exit(void) 995 995 { 996 - of_unregister_platform_driver(&qec_sbus_driver); 996 + platform_driver_unregister(&qec_sbus_driver); 997 997 998 998 while (root_qec_dev) { 999 999 struct sunqec *next = root_qec_dev->next_module;
+4 -4
drivers/net/ucc_geth.c
··· 3740 3740 #endif 3741 3741 }; 3742 3742 3743 - static int ucc_geth_probe(struct platform_device* ofdev, const struct of_device_id *match) 3743 + static int ucc_geth_probe(struct platform_device* ofdev) 3744 3744 { 3745 3745 struct device *device = &ofdev->dev; 3746 3746 struct device_node *np = ofdev->dev.of_node; ··· 3986 3986 3987 3987 MODULE_DEVICE_TABLE(of, ucc_geth_match); 3988 3988 3989 - static struct of_platform_driver ucc_geth_driver = { 3989 + static struct platform_driver ucc_geth_driver = { 3990 3990 .driver = { 3991 3991 .name = DRV_NAME, 3992 3992 .owner = THIS_MODULE, ··· 4008 4008 memcpy(&(ugeth_info[i]), &ugeth_primary_info, 4009 4009 sizeof(ugeth_primary_info)); 4010 4010 4011 - ret = of_register_platform_driver(&ucc_geth_driver); 4011 + ret = platform_driver_register(&ucc_geth_driver); 4012 4012 4013 4013 return ret; 4014 4014 } 4015 4015 4016 4016 static void __exit ucc_geth_exit(void) 4017 4017 { 4018 - of_unregister_platform_driver(&ucc_geth_driver); 4018 + platform_driver_unregister(&ucc_geth_driver); 4019 4019 } 4020 4020 4021 4021 module_init(ucc_geth_init);
+4 -5
drivers/net/xilinx_emaclite.c
··· 1101 1101 * Return: 0, if the driver is bound to the Emaclite device, or 1102 1102 * a negative error if there is failure. 1103 1103 */ 1104 - static int __devinit xemaclite_of_probe(struct platform_device *ofdev, 1105 - const struct of_device_id *match) 1104 + static int __devinit xemaclite_of_probe(struct platform_device *ofdev) 1106 1105 { 1107 1106 struct resource r_irq; /* Interrupt resources */ 1108 1107 struct resource r_mem; /* IO mem resources */ ··· 1287 1288 }; 1288 1289 MODULE_DEVICE_TABLE(of, xemaclite_of_match); 1289 1290 1290 - static struct of_platform_driver xemaclite_of_driver = { 1291 + static struct platform_driver xemaclite_of_driver = { 1291 1292 .driver = { 1292 1293 .name = DRIVER_NAME, 1293 1294 .owner = THIS_MODULE, ··· 1305 1306 static int __init xemaclite_init(void) 1306 1307 { 1307 1308 /* No kernel boot options used, we just need to register the driver */ 1308 - return of_register_platform_driver(&xemaclite_of_driver); 1309 + return platform_driver_register(&xemaclite_of_driver); 1309 1310 } 1310 1311 1311 1312 /** ··· 1313 1314 */ 1314 1315 static void __exit xemaclite_cleanup(void) 1315 1316 { 1316 - of_unregister_platform_driver(&xemaclite_of_driver); 1317 + platform_driver_unregister(&xemaclite_of_driver); 1317 1318 } 1318 1319 1319 1320 module_init(xemaclite_init);
-34
drivers/of/device.c
··· 47 47 } 48 48 EXPORT_SYMBOL(of_dev_put); 49 49 50 - static ssize_t devspec_show(struct device *dev, 51 - struct device_attribute *attr, char *buf) 52 - { 53 - struct platform_device *ofdev; 54 - 55 - ofdev = to_platform_device(dev); 56 - return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name); 57 - } 58 - 59 - static ssize_t name_show(struct device *dev, 60 - struct device_attribute *attr, char *buf) 61 - { 62 - struct platform_device *ofdev; 63 - 64 - ofdev = to_platform_device(dev); 65 - return sprintf(buf, "%s\n", ofdev->dev.of_node->name); 66 - } 67 - 68 - static ssize_t modalias_show(struct device *dev, 69 - struct device_attribute *attr, char *buf) 70 - { 71 - ssize_t len = of_device_get_modalias(dev, buf, PAGE_SIZE - 2); 72 - buf[len] = '\n'; 73 - buf[len+1] = 0; 74 - return len+1; 75 - } 76 - 77 - struct device_attribute of_platform_device_attrs[] = { 78 - __ATTR_RO(devspec), 79 - __ATTR_RO(name), 80 - __ATTR_RO(modalias), 81 - __ATTR_NULL 82 - }; 83 - 84 50 int of_device_add(struct platform_device *ofdev) 85 51 { 86 52 BUG_ON(ofdev->dev.of_node == NULL);
-461
drivers/of/platform.c
··· 42 42 } 43 43 EXPORT_SYMBOL(of_find_device_by_node); 44 44 45 - static int platform_driver_probe_shim(struct platform_device *pdev) 46 - { 47 - struct platform_driver *pdrv; 48 - struct of_platform_driver *ofpdrv; 49 - const struct of_device_id *match; 50 - 51 - pdrv = container_of(pdev->dev.driver, struct platform_driver, driver); 52 - ofpdrv = container_of(pdrv, struct of_platform_driver, platform_driver); 53 - 54 - /* There is an unlikely chance that an of_platform driver might match 55 - * on a non-OF platform device. If so, then of_match_device() will 56 - * come up empty. Return -EINVAL in this case so other drivers get 57 - * the chance to bind. */ 58 - match = of_match_device(pdev->dev.driver->of_match_table, &pdev->dev); 59 - return match ? ofpdrv->probe(pdev, match) : -EINVAL; 60 - } 61 - 62 - static void platform_driver_shutdown_shim(struct platform_device *pdev) 63 - { 64 - struct platform_driver *pdrv; 65 - struct of_platform_driver *ofpdrv; 66 - 67 - pdrv = container_of(pdev->dev.driver, struct platform_driver, driver); 68 - ofpdrv = container_of(pdrv, struct of_platform_driver, platform_driver); 69 - ofpdrv->shutdown(pdev); 70 - } 71 - 72 - /** 73 - * of_register_platform_driver 74 - */ 75 - int of_register_platform_driver(struct of_platform_driver *drv) 76 - { 77 - char *of_name; 78 - 79 - /* setup of_platform_driver to platform_driver adaptors */ 80 - drv->platform_driver.driver = drv->driver; 81 - 82 - /* Prefix the driver name with 'of:' to avoid namespace collisions 83 - * and bogus matches. There are some drivers in the tree that 84 - * register both an of_platform_driver and a platform_driver with 85 - * the same name. This is a temporary measure until they are all 86 - * cleaned up --gcl July 29, 2010 */ 87 - of_name = kmalloc(strlen(drv->driver.name) + 5, GFP_KERNEL); 88 - if (!of_name) 89 - return -ENOMEM; 90 - sprintf(of_name, "of:%s", drv->driver.name); 91 - drv->platform_driver.driver.name = of_name; 92 - 93 - if (drv->probe) 94 - drv->platform_driver.probe = platform_driver_probe_shim; 95 - drv->platform_driver.remove = drv->remove; 96 - if (drv->shutdown) 97 - drv->platform_driver.shutdown = platform_driver_shutdown_shim; 98 - drv->platform_driver.suspend = drv->suspend; 99 - drv->platform_driver.resume = drv->resume; 100 - 101 - return platform_driver_register(&drv->platform_driver); 102 - } 103 - EXPORT_SYMBOL(of_register_platform_driver); 104 - 105 - void of_unregister_platform_driver(struct of_platform_driver *drv) 106 - { 107 - platform_driver_unregister(&drv->platform_driver); 108 - kfree(drv->platform_driver.driver.name); 109 - drv->platform_driver.driver.name = NULL; 110 - } 111 - EXPORT_SYMBOL(of_unregister_platform_driver); 112 - 113 45 #if defined(CONFIG_PPC_DCR) 114 46 #include <asm/dcr.h> 115 47 #endif 116 - 117 - extern struct device_attribute of_platform_device_attrs[]; 118 - 119 - static int of_platform_bus_match(struct device *dev, struct device_driver *drv) 120 - { 121 - const struct of_device_id *matches = drv->of_match_table; 122 - 123 - if (!matches) 124 - return 0; 125 - 126 - return of_match_device(matches, dev) != NULL; 127 - } 128 - 129 - static int of_platform_device_probe(struct device *dev) 130 - { 131 - int error = -ENODEV; 132 - struct of_platform_driver *drv; 133 - struct platform_device *of_dev; 134 - const struct of_device_id *match; 135 - 136 - drv = to_of_platform_driver(dev->driver); 137 - of_dev = to_platform_device(dev); 138 - 139 - if (!drv->probe) 140 - return error; 141 - 142 - of_dev_get(of_dev); 143 - 144 - match = of_match_device(drv->driver.of_match_table, dev); 145 - if (match) 146 - error = drv->probe(of_dev, match); 147 - if (error) 148 - of_dev_put(of_dev); 149 - 150 - return error; 151 - } 152 - 153 - static int of_platform_device_remove(struct device *dev) 154 - { 155 - struct platform_device *of_dev = to_platform_device(dev); 156 - struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 157 - 158 - if (dev->driver && drv->remove) 159 - drv->remove(of_dev); 160 - return 0; 161 - } 162 - 163 - static void of_platform_device_shutdown(struct device *dev) 164 - { 165 - struct platform_device *of_dev = to_platform_device(dev); 166 - struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 167 - 168 - if (dev->driver && drv->shutdown) 169 - drv->shutdown(of_dev); 170 - } 171 - 172 - #ifdef CONFIG_PM_SLEEP 173 - 174 - static int of_platform_legacy_suspend(struct device *dev, pm_message_t mesg) 175 - { 176 - struct platform_device *of_dev = to_platform_device(dev); 177 - struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 178 - int ret = 0; 179 - 180 - if (dev->driver && drv->suspend) 181 - ret = drv->suspend(of_dev, mesg); 182 - return ret; 183 - } 184 - 185 - static int of_platform_legacy_resume(struct device *dev) 186 - { 187 - struct platform_device *of_dev = to_platform_device(dev); 188 - struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 189 - int ret = 0; 190 - 191 - if (dev->driver && drv->resume) 192 - ret = drv->resume(of_dev); 193 - return ret; 194 - } 195 - 196 - static int of_platform_pm_prepare(struct device *dev) 197 - { 198 - struct device_driver *drv = dev->driver; 199 - int ret = 0; 200 - 201 - if (drv && drv->pm && drv->pm->prepare) 202 - ret = drv->pm->prepare(dev); 203 - 204 - return ret; 205 - } 206 - 207 - static void of_platform_pm_complete(struct device *dev) 208 - { 209 - struct device_driver *drv = dev->driver; 210 - 211 - if (drv && drv->pm && drv->pm->complete) 212 - drv->pm->complete(dev); 213 - } 214 - 215 - #ifdef CONFIG_SUSPEND 216 - 217 - static int of_platform_pm_suspend(struct device *dev) 218 - { 219 - struct device_driver *drv = dev->driver; 220 - int ret = 0; 221 - 222 - if (!drv) 223 - return 0; 224 - 225 - if (drv->pm) { 226 - if (drv->pm->suspend) 227 - ret = drv->pm->suspend(dev); 228 - } else { 229 - ret = of_platform_legacy_suspend(dev, PMSG_SUSPEND); 230 - } 231 - 232 - return ret; 233 - } 234 - 235 - static int of_platform_pm_suspend_noirq(struct device *dev) 236 - { 237 - struct device_driver *drv = dev->driver; 238 - int ret = 0; 239 - 240 - if (!drv) 241 - return 0; 242 - 243 - if (drv->pm) { 244 - if (drv->pm->suspend_noirq) 245 - ret = drv->pm->suspend_noirq(dev); 246 - } 247 - 248 - return ret; 249 - } 250 - 251 - static int of_platform_pm_resume(struct device *dev) 252 - { 253 - struct device_driver *drv = dev->driver; 254 - int ret = 0; 255 - 256 - if (!drv) 257 - return 0; 258 - 259 - if (drv->pm) { 260 - if (drv->pm->resume) 261 - ret = drv->pm->resume(dev); 262 - } else { 263 - ret = of_platform_legacy_resume(dev); 264 - } 265 - 266 - return ret; 267 - } 268 - 269 - static int of_platform_pm_resume_noirq(struct device *dev) 270 - { 271 - struct device_driver *drv = dev->driver; 272 - int ret = 0; 273 - 274 - if (!drv) 275 - return 0; 276 - 277 - if (drv->pm) { 278 - if (drv->pm->resume_noirq) 279 - ret = drv->pm->resume_noirq(dev); 280 - } 281 - 282 - return ret; 283 - } 284 - 285 - #else /* !CONFIG_SUSPEND */ 286 - 287 - #define of_platform_pm_suspend NULL 288 - #define of_platform_pm_resume NULL 289 - #define of_platform_pm_suspend_noirq NULL 290 - #define of_platform_pm_resume_noirq NULL 291 - 292 - #endif /* !CONFIG_SUSPEND */ 293 - 294 - #ifdef CONFIG_HIBERNATION 295 - 296 - static int of_platform_pm_freeze(struct device *dev) 297 - { 298 - struct device_driver *drv = dev->driver; 299 - int ret = 0; 300 - 301 - if (!drv) 302 - return 0; 303 - 304 - if (drv->pm) { 305 - if (drv->pm->freeze) 306 - ret = drv->pm->freeze(dev); 307 - } else { 308 - ret = of_platform_legacy_suspend(dev, PMSG_FREEZE); 309 - } 310 - 311 - return ret; 312 - } 313 - 314 - static int of_platform_pm_freeze_noirq(struct device *dev) 315 - { 316 - struct device_driver *drv = dev->driver; 317 - int ret = 0; 318 - 319 - if (!drv) 320 - return 0; 321 - 322 - if (drv->pm) { 323 - if (drv->pm->freeze_noirq) 324 - ret = drv->pm->freeze_noirq(dev); 325 - } 326 - 327 - return ret; 328 - } 329 - 330 - static int of_platform_pm_thaw(struct device *dev) 331 - { 332 - struct device_driver *drv = dev->driver; 333 - int ret = 0; 334 - 335 - if (!drv) 336 - return 0; 337 - 338 - if (drv->pm) { 339 - if (drv->pm->thaw) 340 - ret = drv->pm->thaw(dev); 341 - } else { 342 - ret = of_platform_legacy_resume(dev); 343 - } 344 - 345 - return ret; 346 - } 347 - 348 - static int of_platform_pm_thaw_noirq(struct device *dev) 349 - { 350 - struct device_driver *drv = dev->driver; 351 - int ret = 0; 352 - 353 - if (!drv) 354 - return 0; 355 - 356 - if (drv->pm) { 357 - if (drv->pm->thaw_noirq) 358 - ret = drv->pm->thaw_noirq(dev); 359 - } 360 - 361 - return ret; 362 - } 363 - 364 - static int of_platform_pm_poweroff(struct device *dev) 365 - { 366 - struct device_driver *drv = dev->driver; 367 - int ret = 0; 368 - 369 - if (!drv) 370 - return 0; 371 - 372 - if (drv->pm) { 373 - if (drv->pm->poweroff) 374 - ret = drv->pm->poweroff(dev); 375 - } else { 376 - ret = of_platform_legacy_suspend(dev, PMSG_HIBERNATE); 377 - } 378 - 379 - return ret; 380 - } 381 - 382 - static int of_platform_pm_poweroff_noirq(struct device *dev) 383 - { 384 - struct device_driver *drv = dev->driver; 385 - int ret = 0; 386 - 387 - if (!drv) 388 - return 0; 389 - 390 - if (drv->pm) { 391 - if (drv->pm->poweroff_noirq) 392 - ret = drv->pm->poweroff_noirq(dev); 393 - } 394 - 395 - return ret; 396 - } 397 - 398 - static int of_platform_pm_restore(struct device *dev) 399 - { 400 - struct device_driver *drv = dev->driver; 401 - int ret = 0; 402 - 403 - if (!drv) 404 - return 0; 405 - 406 - if (drv->pm) { 407 - if (drv->pm->restore) 408 - ret = drv->pm->restore(dev); 409 - } else { 410 - ret = of_platform_legacy_resume(dev); 411 - } 412 - 413 - return ret; 414 - } 415 - 416 - static int of_platform_pm_restore_noirq(struct device *dev) 417 - { 418 - struct device_driver *drv = dev->driver; 419 - int ret = 0; 420 - 421 - if (!drv) 422 - return 0; 423 - 424 - if (drv->pm) { 425 - if (drv->pm->restore_noirq) 426 - ret = drv->pm->restore_noirq(dev); 427 - } 428 - 429 - return ret; 430 - } 431 - 432 - #else /* !CONFIG_HIBERNATION */ 433 - 434 - #define of_platform_pm_freeze NULL 435 - #define of_platform_pm_thaw NULL 436 - #define of_platform_pm_poweroff NULL 437 - #define of_platform_pm_restore NULL 438 - #define of_platform_pm_freeze_noirq NULL 439 - #define of_platform_pm_thaw_noirq NULL 440 - #define of_platform_pm_poweroff_noirq NULL 441 - #define of_platform_pm_restore_noirq NULL 442 - 443 - #endif /* !CONFIG_HIBERNATION */ 444 - 445 - static struct dev_pm_ops of_platform_dev_pm_ops = { 446 - .prepare = of_platform_pm_prepare, 447 - .complete = of_platform_pm_complete, 448 - .suspend = of_platform_pm_suspend, 449 - .resume = of_platform_pm_resume, 450 - .freeze = of_platform_pm_freeze, 451 - .thaw = of_platform_pm_thaw, 452 - .poweroff = of_platform_pm_poweroff, 453 - .restore = of_platform_pm_restore, 454 - .suspend_noirq = of_platform_pm_suspend_noirq, 455 - .resume_noirq = of_platform_pm_resume_noirq, 456 - .freeze_noirq = of_platform_pm_freeze_noirq, 457 - .thaw_noirq = of_platform_pm_thaw_noirq, 458 - .poweroff_noirq = of_platform_pm_poweroff_noirq, 459 - .restore_noirq = of_platform_pm_restore_noirq, 460 - }; 461 - 462 - #define OF_PLATFORM_PM_OPS_PTR (&of_platform_dev_pm_ops) 463 - 464 - #else /* !CONFIG_PM_SLEEP */ 465 - 466 - #define OF_PLATFORM_PM_OPS_PTR NULL 467 - 468 - #endif /* !CONFIG_PM_SLEEP */ 469 - 470 - int of_bus_type_init(struct bus_type *bus, const char *name) 471 - { 472 - bus->name = name; 473 - bus->match = of_platform_bus_match; 474 - bus->probe = of_platform_device_probe; 475 - bus->remove = of_platform_device_remove; 476 - bus->shutdown = of_platform_device_shutdown; 477 - bus->dev_attrs = of_platform_device_attrs; 478 - bus->pm = OF_PLATFORM_PM_OPS_PTR; 479 - return bus_register(bus); 480 - } 481 - 482 - int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus) 483 - { 484 - /* 485 - * Temporary: of_platform_bus used to be distinct from the platform 486 - * bus. It isn't anymore, and so drivers on the platform bus need 487 - * to be registered in a special way. 488 - * 489 - * After all of_platform_bus_type drivers are converted to 490 - * platform_drivers, this exception can be removed. 491 - */ 492 - if (bus == &platform_bus_type) 493 - return of_register_platform_driver(drv); 494 - 495 - /* register with core */ 496 - drv->driver.bus = bus; 497 - return driver_register(&drv->driver); 498 - } 499 - EXPORT_SYMBOL(of_register_driver); 500 - 501 - void of_unregister_driver(struct of_platform_driver *drv) 502 - { 503 - if (drv->driver.bus == &platform_bus_type) 504 - of_unregister_platform_driver(drv); 505 - else 506 - driver_unregister(&drv->driver); 507 - } 508 - EXPORT_SYMBOL(of_unregister_driver); 509 48 510 49 #if !defined(CONFIG_SPARC) 511 50 /*
+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/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
··· 248 248 .alarm_irq_enable = mpc5121_rtc_alarm_irq_enable, 249 249 }; 250 250 251 - static int __devinit mpc5121_rtc_probe(struct platform_device *op, 252 - const struct of_device_id *match) 251 + static int __devinit mpc5121_rtc_probe(struct platform_device *op) 253 252 { 254 253 struct mpc5121_rtc_data *rtc; 255 254 int err = 0; ··· 343 344 {}, 344 345 }; 345 346 346 - static struct of_platform_driver mpc5121_rtc_driver = { 347 + static struct platform_driver mpc5121_rtc_driver = { 347 348 .driver = { 348 349 .name = "mpc5121-rtc", 349 350 .owner = THIS_MODULE, ··· 355 356 356 357 static int __init mpc5121_rtc_init(void) 357 358 { 358 - return of_register_platform_driver(&mpc5121_rtc_driver); 359 + return platform_driver_register(&mpc5121_rtc_driver); 359 360 } 360 361 module_init(mpc5121_rtc_init); 361 362 362 363 static void __exit mpc5121_rtc_exit(void) 363 364 { 364 - of_unregister_platform_driver(&mpc5121_rtc_driver); 365 + platform_driver_unregister(&mpc5121_rtc_driver); 365 366 } 366 367 module_exit(mpc5121_rtc_exit); 367 368
+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");
+4 -5
drivers/spi/mpc512x_psc_spi.c
··· 507 507 return 0; 508 508 } 509 509 510 - static int __devinit mpc512x_psc_spi_of_probe(struct platform_device *op, 511 - const struct of_device_id *match) 510 + static int __devinit mpc512x_psc_spi_of_probe(struct platform_device *op) 512 511 { 513 512 const u32 *regaddr_p; 514 513 u64 regaddr64, size64; ··· 550 551 551 552 MODULE_DEVICE_TABLE(of, mpc512x_psc_spi_of_match); 552 553 553 - static struct of_platform_driver mpc512x_psc_spi_of_driver = { 554 + static struct platform_driver mpc512x_psc_spi_of_driver = { 554 555 .probe = mpc512x_psc_spi_of_probe, 555 556 .remove = __devexit_p(mpc512x_psc_spi_of_remove), 556 557 .driver = { ··· 562 563 563 564 static int __init mpc512x_psc_spi_init(void) 564 565 { 565 - return of_register_platform_driver(&mpc512x_psc_spi_of_driver); 566 + return platform_driver_register(&mpc512x_psc_spi_of_driver); 566 567 } 567 568 module_init(mpc512x_psc_spi_init); 568 569 569 570 static void __exit mpc512x_psc_spi_exit(void) 570 571 { 571 - of_unregister_platform_driver(&mpc512x_psc_spi_of_driver); 572 + platform_driver_unregister(&mpc512x_psc_spi_of_driver); 572 573 } 573 574 module_exit(mpc512x_psc_spi_exit); 574 575
+4 -5
drivers/spi/mpc52xx_psc_spi.c
··· 450 450 return ret; 451 451 } 452 452 453 - static int __devinit mpc52xx_psc_spi_of_probe(struct platform_device *op, 454 - const struct of_device_id *match) 453 + static int __devinit mpc52xx_psc_spi_of_probe(struct platform_device *op) 455 454 { 456 455 const u32 *regaddr_p; 457 456 u64 regaddr64, size64; ··· 502 503 503 504 MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match); 504 505 505 - static struct of_platform_driver mpc52xx_psc_spi_of_driver = { 506 + static struct platform_driver mpc52xx_psc_spi_of_driver = { 506 507 .probe = mpc52xx_psc_spi_of_probe, 507 508 .remove = __devexit_p(mpc52xx_psc_spi_of_remove), 508 509 .driver = { ··· 514 515 515 516 static int __init mpc52xx_psc_spi_init(void) 516 517 { 517 - return of_register_platform_driver(&mpc52xx_psc_spi_of_driver); 518 + return platform_driver_register(&mpc52xx_psc_spi_of_driver); 518 519 } 519 520 module_init(mpc52xx_psc_spi_init); 520 521 521 522 static void __exit mpc52xx_psc_spi_exit(void) 522 523 { 523 - of_unregister_platform_driver(&mpc52xx_psc_spi_of_driver); 524 + platform_driver_unregister(&mpc52xx_psc_spi_of_driver); 524 525 } 525 526 module_exit(mpc52xx_psc_spi_exit); 526 527
+4 -5
drivers/spi/mpc52xx_spi.c
··· 390 390 /* 391 391 * OF Platform Bus Binding 392 392 */ 393 - static int __devinit mpc52xx_spi_probe(struct platform_device *op, 394 - const struct of_device_id *match) 393 + static int __devinit mpc52xx_spi_probe(struct platform_device *op) 395 394 { 396 395 struct spi_master *master; 397 396 struct mpc52xx_spi *ms; ··· 555 556 }; 556 557 MODULE_DEVICE_TABLE(of, mpc52xx_spi_match); 557 558 558 - static struct of_platform_driver mpc52xx_spi_of_driver = { 559 + static struct platform_driver mpc52xx_spi_of_driver = { 559 560 .driver = { 560 561 .name = "mpc52xx-spi", 561 562 .owner = THIS_MODULE, ··· 567 568 568 569 static int __init mpc52xx_spi_init(void) 569 570 { 570 - return of_register_platform_driver(&mpc52xx_spi_of_driver); 571 + return platform_driver_register(&mpc52xx_spi_of_driver); 571 572 } 572 573 module_init(mpc52xx_spi_init); 573 574 574 575 static void __exit mpc52xx_spi_exit(void) 575 576 { 576 - of_unregister_platform_driver(&mpc52xx_spi_of_driver); 577 + platform_driver_unregister(&mpc52xx_spi_of_driver); 577 578 } 578 579 module_exit(mpc52xx_spi_exit); 579 580
+5 -6
drivers/spi/spi_fsl_espi.c
··· 685 685 return 0; 686 686 } 687 687 688 - static int __devinit of_fsl_espi_probe(struct platform_device *ofdev, 689 - const struct of_device_id *ofid) 688 + static int __devinit of_fsl_espi_probe(struct platform_device *ofdev) 690 689 { 691 690 struct device *dev = &ofdev->dev; 692 691 struct device_node *np = ofdev->dev.of_node; ··· 694 695 struct resource irq; 695 696 int ret = -ENOMEM; 696 697 697 - ret = of_mpc8xxx_spi_probe(ofdev, ofid); 698 + ret = of_mpc8xxx_spi_probe(ofdev); 698 699 if (ret) 699 700 return ret; 700 701 ··· 735 736 }; 736 737 MODULE_DEVICE_TABLE(of, of_fsl_espi_match); 737 738 738 - static struct of_platform_driver fsl_espi_driver = { 739 + static struct platform_driver fsl_espi_driver = { 739 740 .driver = { 740 741 .name = "fsl_espi", 741 742 .owner = THIS_MODULE, ··· 747 748 748 749 static int __init fsl_espi_init(void) 749 750 { 750 - return of_register_platform_driver(&fsl_espi_driver); 751 + return platform_driver_register(&fsl_espi_driver); 751 752 } 752 753 module_init(fsl_espi_init); 753 754 754 755 static void __exit fsl_espi_exit(void) 755 756 { 756 - of_unregister_platform_driver(&fsl_espi_driver); 757 + platform_driver_unregister(&fsl_espi_driver); 757 758 } 758 759 module_exit(fsl_espi_exit); 759 760
+1 -2
drivers/spi/spi_fsl_lib.c
··· 189 189 return 0; 190 190 } 191 191 192 - int __devinit of_mpc8xxx_spi_probe(struct platform_device *ofdev, 193 - const struct of_device_id *ofid) 192 + int __devinit of_mpc8xxx_spi_probe(struct platform_device *ofdev) 194 193 { 195 194 struct device *dev = &ofdev->dev; 196 195 struct device_node *np = ofdev->dev.of_node;
+1 -2
drivers/spi/spi_fsl_lib.h
··· 118 118 extern int mpc8xxx_spi_probe(struct device *dev, struct resource *mem, 119 119 unsigned int irq); 120 120 extern int mpc8xxx_spi_remove(struct device *dev); 121 - extern int of_mpc8xxx_spi_probe(struct platform_device *ofdev, 122 - const struct of_device_id *ofid); 121 + extern int of_mpc8xxx_spi_probe(struct platform_device *ofdev); 123 122 124 123 #endif /* __SPI_FSL_LIB_H__ */
+5 -6
drivers/spi/spi_fsl_spi.c
··· 1042 1042 return 0; 1043 1043 } 1044 1044 1045 - static int __devinit of_fsl_spi_probe(struct platform_device *ofdev, 1046 - const struct of_device_id *ofid) 1045 + static int __devinit of_fsl_spi_probe(struct platform_device *ofdev) 1047 1046 { 1048 1047 struct device *dev = &ofdev->dev; 1049 1048 struct device_node *np = ofdev->dev.of_node; ··· 1051 1052 struct resource irq; 1052 1053 int ret = -ENOMEM; 1053 1054 1054 - ret = of_mpc8xxx_spi_probe(ofdev, ofid); 1055 + ret = of_mpc8xxx_spi_probe(ofdev); 1055 1056 if (ret) 1056 1057 return ret; 1057 1058 ··· 1099 1100 }; 1100 1101 MODULE_DEVICE_TABLE(of, of_fsl_spi_match); 1101 1102 1102 - static struct of_platform_driver of_fsl_spi_driver = { 1103 + static struct platform_driver of_fsl_spi_driver = { 1103 1104 .driver = { 1104 1105 .name = "fsl_spi", 1105 1106 .owner = THIS_MODULE, ··· 1176 1177 static int __init fsl_spi_init(void) 1177 1178 { 1178 1179 legacy_driver_register(); 1179 - return of_register_platform_driver(&of_fsl_spi_driver); 1180 + return platform_driver_register(&of_fsl_spi_driver); 1180 1181 } 1181 1182 module_init(fsl_spi_init); 1182 1183 1183 1184 static void __exit fsl_spi_exit(void) 1184 1185 { 1185 - of_unregister_platform_driver(&of_fsl_spi_driver); 1186 + platform_driver_unregister(&of_fsl_spi_driver); 1186 1187 legacy_driver_unregister(); 1187 1188 } 1188 1189 module_exit(fsl_spi_exit);
+4 -5
drivers/spi/spi_ppc4xx.c
··· 390 390 /* 391 391 * platform_device layer stuff... 392 392 */ 393 - static int __init spi_ppc4xx_of_probe(struct platform_device *op, 394 - const struct of_device_id *match) 393 + static int __init spi_ppc4xx_of_probe(struct platform_device *op) 395 394 { 396 395 struct ppc4xx_spi *hw; 397 396 struct spi_master *master; ··· 585 586 586 587 MODULE_DEVICE_TABLE(of, spi_ppc4xx_of_match); 587 588 588 - static struct of_platform_driver spi_ppc4xx_of_driver = { 589 + static struct platform_driver spi_ppc4xx_of_driver = { 589 590 .probe = spi_ppc4xx_of_probe, 590 591 .remove = __exit_p(spi_ppc4xx_of_remove), 591 592 .driver = { ··· 597 598 598 599 static int __init spi_ppc4xx_init(void) 599 600 { 600 - return of_register_platform_driver(&spi_ppc4xx_of_driver); 601 + return platform_driver_register(&spi_ppc4xx_of_driver); 601 602 } 602 603 module_init(spi_ppc4xx_init); 603 604 604 605 static void __exit spi_ppc4xx_exit(void) 605 606 { 606 - of_unregister_platform_driver(&spi_ppc4xx_of_driver); 607 + platform_driver_unregister(&spi_ppc4xx_of_driver); 607 608 } 608 609 module_exit(spi_ppc4xx_exit); 609 610
+13 -2
drivers/tty/serial/altera_jtaguart.c
··· 466 466 return 0; 467 467 } 468 468 469 + #ifdef CONFIG_OF 470 + static struct of_device_id altera_jtaguart_match[] = { 471 + { .compatible = "ALTR,juart-1.0", }, 472 + {}, 473 + }; 474 + MODULE_DEVICE_TABLE(of, altera_jtaguart_match); 475 + #else 476 + #define altera_jtaguart_match NULL 477 + #endif /* CONFIG_OF */ 478 + 469 479 static struct platform_driver altera_jtaguart_platform_driver = { 470 480 .probe = altera_jtaguart_probe, 471 481 .remove = __devexit_p(altera_jtaguart_remove), 472 482 .driver = { 473 - .name = DRV_NAME, 474 - .owner = THIS_MODULE, 483 + .name = DRV_NAME, 484 + .owner = THIS_MODULE, 485 + .of_match_table = altera_jtaguart_match, 475 486 }, 476 487 }; 477 488
+47 -4
drivers/tty/serial/altera_uart.c
··· 24 24 #include <linux/serial.h> 25 25 #include <linux/serial_core.h> 26 26 #include <linux/platform_device.h> 27 + #include <linux/of.h> 27 28 #include <linux/io.h> 28 29 #include <linux/altera_uart.h> 29 30 ··· 508 507 .cons = ALTERA_UART_CONSOLE, 509 508 }; 510 509 510 + #ifdef CONFIG_OF 511 + static int altera_uart_get_of_uartclk(struct platform_device *pdev, 512 + struct uart_port *port) 513 + { 514 + int len; 515 + const __be32 *clk; 516 + 517 + clk = of_get_property(pdev->dev.of_node, "clock-frequency", &len); 518 + if (!clk || len < sizeof(__be32)) 519 + return -ENODEV; 520 + 521 + port->uartclk = be32_to_cpup(clk); 522 + 523 + return 0; 524 + } 525 + #else 526 + static int altera_uart_get_of_uartclk(struct platform_device *pdev, 527 + struct uart_port *port) 528 + { 529 + return -ENODEV; 530 + } 531 + #endif /* CONFIG_OF */ 532 + 511 533 static int __devinit altera_uart_probe(struct platform_device *pdev) 512 534 { 513 535 struct altera_uart_platform_uart *platp = pdev->dev.platform_data; ··· 538 514 struct resource *res_mem; 539 515 struct resource *res_irq; 540 516 int i = pdev->id; 517 + int ret; 541 518 542 519 /* -1 emphasizes that the platform must have one port, no .N suffix */ 543 520 if (i == -1) ··· 563 538 else if (platp->irq) 564 539 port->irq = platp->irq; 565 540 541 + /* Check platform data first so we can override device node data */ 542 + if (platp) 543 + port->uartclk = platp->uartclk; 544 + else { 545 + ret = altera_uart_get_of_uartclk(pdev, port); 546 + if (ret) 547 + return ret; 548 + } 549 + 566 550 port->membase = ioremap(port->mapbase, ALTERA_UART_SIZE); 567 551 if (!port->membase) 568 552 return -ENOMEM; ··· 584 550 port->line = i; 585 551 port->type = PORT_ALTERA_UART; 586 552 port->iotype = SERIAL_IO_MEM; 587 - port->uartclk = platp->uartclk; 588 553 port->ops = &altera_uart_ops; 589 554 port->flags = UPF_BOOT_AUTOCONF; 590 555 ··· 606 573 return 0; 607 574 } 608 575 576 + #ifdef CONFIG_OF 577 + static struct of_device_id altera_uart_match[] = { 578 + { .compatible = "ALTR,uart-1.0", }, 579 + {}, 580 + }; 581 + MODULE_DEVICE_TABLE(of, altera_uart_match); 582 + #else 583 + #define altera_uart_match NULL 584 + #endif /* CONFIG_OF */ 585 + 609 586 static struct platform_driver altera_uart_platform_driver = { 610 587 .probe = altera_uart_probe, 611 588 .remove = __devexit_p(altera_uart_remove), 612 589 .driver = { 613 - .name = DRV_NAME, 614 - .owner = THIS_MODULE, 615 - .pm = NULL, 590 + .name = DRV_NAME, 591 + .owner = THIS_MODULE, 592 + .of_match_table = altera_uart_match, 616 593 }, 617 594 }; 618 595
+5 -6
drivers/tty/serial/apbuart.c
··· 553 553 /* OF Platform Driver */ 554 554 /* ======================================================================== */ 555 555 556 - static int __devinit apbuart_probe(struct platform_device *op, 557 - const struct of_device_id *match) 556 + static int __devinit apbuart_probe(struct platform_device *op) 558 557 { 559 558 int i = -1; 560 559 struct uart_port *port = NULL; ··· 586 587 {}, 587 588 }; 588 589 589 - static struct of_platform_driver grlib_apbuart_of_driver = { 590 + static struct platform_driver grlib_apbuart_of_driver = { 590 591 .probe = apbuart_probe, 591 592 .driver = { 592 593 .owner = THIS_MODULE, ··· 675 676 return ret; 676 677 } 677 678 678 - ret = of_register_platform_driver(&grlib_apbuart_of_driver); 679 + ret = platform_driver_register(&grlib_apbuart_of_driver); 679 680 if (ret) { 680 681 printk(KERN_ERR 681 - "%s: of_register_platform_driver failed (%i)\n", 682 + "%s: platform_driver_register failed (%i)\n", 682 683 __FILE__, ret); 683 684 uart_unregister_driver(&grlib_apbuart_driver); 684 685 return ret; ··· 696 697 &grlib_apbuart_ports[i]); 697 698 698 699 uart_unregister_driver(&grlib_apbuart_driver); 699 - of_unregister_platform_driver(&grlib_apbuart_of_driver); 700 + platform_driver_unregister(&grlib_apbuart_of_driver); 700 701 } 701 702 702 703 module_init(grlib_apbuart_init);
+4 -5
drivers/tty/serial/cpm_uart/cpm_uart_core.c
··· 1359 1359 1360 1360 static int probe_index; 1361 1361 1362 - static int __devinit cpm_uart_probe(struct platform_device *ofdev, 1363 - const struct of_device_id *match) 1362 + static int __devinit cpm_uart_probe(struct platform_device *ofdev) 1364 1363 { 1365 1364 int index = probe_index++; 1366 1365 struct uart_cpm_port *pinfo = &cpm_uart_ports[index]; ··· 1404 1405 {} 1405 1406 }; 1406 1407 1407 - static struct of_platform_driver cpm_uart_driver = { 1408 + static struct platform_driver cpm_uart_driver = { 1408 1409 .driver = { 1409 1410 .name = "cpm_uart", 1410 1411 .owner = THIS_MODULE, ··· 1420 1421 if (ret) 1421 1422 return ret; 1422 1423 1423 - ret = of_register_platform_driver(&cpm_uart_driver); 1424 + ret = platform_driver_register(&cpm_uart_driver); 1424 1425 if (ret) 1425 1426 uart_unregister_driver(&cpm_reg); 1426 1427 ··· 1429 1430 1430 1431 static void __exit cpm_uart_exit(void) 1431 1432 { 1432 - of_unregister_platform_driver(&cpm_uart_driver); 1433 + platform_driver_unregister(&cpm_uart_driver); 1433 1434 uart_unregister_driver(&cpm_reg); 1434 1435 } 1435 1436
+5 -8
drivers/tty/serial/mpc52xx_uart.c
··· 1302 1302 {}, 1303 1303 }; 1304 1304 1305 - static int __devinit 1306 - mpc52xx_uart_of_probe(struct platform_device *op, const struct of_device_id *match) 1305 + static int __devinit mpc52xx_uart_of_probe(struct platform_device *op) 1307 1306 { 1308 1307 int idx = -1; 1309 1308 unsigned int uartclk; 1310 1309 struct uart_port *port = NULL; 1311 1310 struct resource res; 1312 1311 int ret; 1313 - 1314 - dev_dbg(&op->dev, "mpc52xx_uart_probe(op=%p, match=%p)\n", op, match); 1315 1312 1316 1313 /* Check validity & presence */ 1317 1314 for (idx = 0; idx < MPC52xx_PSC_MAXNUM; idx++) ··· 1450 1453 1451 1454 MODULE_DEVICE_TABLE(of, mpc52xx_uart_of_match); 1452 1455 1453 - static struct of_platform_driver mpc52xx_uart_of_driver = { 1456 + static struct platform_driver mpc52xx_uart_of_driver = { 1454 1457 .probe = mpc52xx_uart_of_probe, 1455 1458 .remove = mpc52xx_uart_of_remove, 1456 1459 #ifdef CONFIG_PM ··· 1494 1497 return ret; 1495 1498 } 1496 1499 1497 - ret = of_register_platform_driver(&mpc52xx_uart_of_driver); 1500 + ret = platform_driver_register(&mpc52xx_uart_of_driver); 1498 1501 if (ret) { 1499 - printk(KERN_ERR "%s: of_register_platform_driver failed (%i)\n", 1502 + printk(KERN_ERR "%s: platform_driver_register failed (%i)\n", 1500 1503 __FILE__, ret); 1501 1504 uart_unregister_driver(&mpc52xx_uart_driver); 1502 1505 return ret; ··· 1511 1514 if (psc_ops->fifoc_uninit) 1512 1515 psc_ops->fifoc_uninit(); 1513 1516 1514 - of_unregister_platform_driver(&mpc52xx_uart_of_driver); 1517 + platform_driver_unregister(&mpc52xx_uart_of_driver); 1515 1518 uart_unregister_driver(&mpc52xx_uart_driver); 1516 1519 } 1517 1520
+8 -6
drivers/tty/serial/of_serial.c
··· 80 80 /* 81 81 * Try to register a serial port 82 82 */ 83 - static int __devinit of_platform_serial_probe(struct platform_device *ofdev, 84 - const struct of_device_id *id) 83 + static int __devinit of_platform_serial_probe(struct platform_device *ofdev) 85 84 { 86 85 struct of_serial_info *info; 87 86 struct uart_port port; 88 87 int port_type; 89 88 int ret; 89 + 90 + if (!ofdev->dev.of_match) 91 + return -EINVAL; 90 92 91 93 if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL)) 92 94 return -EBUSY; ··· 97 95 if (info == NULL) 98 96 return -ENOMEM; 99 97 100 - port_type = (unsigned long)id->data; 98 + port_type = (unsigned long)ofdev->dev.of_match->data; 101 99 ret = of_platform_serial_setup(ofdev, port_type, &port); 102 100 if (ret) 103 101 goto out; ··· 176 174 { /* end of list */ }, 177 175 }; 178 176 179 - static struct of_platform_driver of_platform_serial_driver = { 177 + static struct platform_driver of_platform_serial_driver = { 180 178 .driver = { 181 179 .name = "of_serial", 182 180 .owner = THIS_MODULE, ··· 188 186 189 187 static int __init of_platform_serial_init(void) 190 188 { 191 - return of_register_platform_driver(&of_platform_serial_driver); 189 + return platform_driver_register(&of_platform_serial_driver); 192 190 } 193 191 module_init(of_platform_serial_init); 194 192 195 193 static void __exit of_platform_serial_exit(void) 196 194 { 197 - return of_unregister_platform_driver(&of_platform_serial_driver); 195 + return platform_driver_unregister(&of_platform_serial_driver); 198 196 }; 199 197 module_exit(of_platform_serial_exit); 200 198
+4 -4
drivers/tty/serial/sunhv.c
··· 519 519 .data = &sunhv_reg, 520 520 }; 521 521 522 - static int __devinit hv_probe(struct platform_device *op, const struct of_device_id *match) 522 + static int __devinit hv_probe(struct platform_device *op) 523 523 { 524 524 struct uart_port *port; 525 525 unsigned long minor; ··· 629 629 }; 630 630 MODULE_DEVICE_TABLE(of, hv_match); 631 631 632 - static struct of_platform_driver hv_driver = { 632 + static struct platform_driver hv_driver = { 633 633 .driver = { 634 634 .name = "hv", 635 635 .owner = THIS_MODULE, ··· 644 644 if (tlb_type != hypervisor) 645 645 return -ENODEV; 646 646 647 - return of_register_platform_driver(&hv_driver); 647 + return platform_driver_register(&hv_driver); 648 648 } 649 649 650 650 static void __exit sunhv_exit(void) 651 651 { 652 - of_unregister_platform_driver(&hv_driver); 652 + platform_driver_unregister(&hv_driver); 653 653 } 654 654 655 655 module_init(sunhv_init);
+4 -4
drivers/tty/serial/sunsab.c
··· 1006 1006 return 0; 1007 1007 } 1008 1008 1009 - static int __devinit sab_probe(struct platform_device *op, const struct of_device_id *match) 1009 + static int __devinit sab_probe(struct platform_device *op) 1010 1010 { 1011 1011 static int inst; 1012 1012 struct uart_sunsab_port *up; ··· 1092 1092 }; 1093 1093 MODULE_DEVICE_TABLE(of, sab_match); 1094 1094 1095 - static struct of_platform_driver sab_driver = { 1095 + static struct platform_driver sab_driver = { 1096 1096 .driver = { 1097 1097 .name = "sab", 1098 1098 .owner = THIS_MODULE, ··· 1130 1130 } 1131 1131 } 1132 1132 1133 - return of_register_platform_driver(&sab_driver); 1133 + return platform_driver_register(&sab_driver); 1134 1134 } 1135 1135 1136 1136 static void __exit sunsab_exit(void) 1137 1137 { 1138 - of_unregister_platform_driver(&sab_driver); 1138 + platform_driver_unregister(&sab_driver); 1139 1139 if (sunsab_reg.nr) { 1140 1140 sunserial_unregister_minors(&sunsab_reg, sunsab_reg.nr); 1141 1141 }
+3 -3
drivers/tty/serial/sunsu.c
··· 1406 1406 return SU_PORT_PORT; 1407 1407 } 1408 1408 1409 - static int __devinit su_probe(struct platform_device *op, const struct of_device_id *match) 1409 + static int __devinit su_probe(struct platform_device *op) 1410 1410 { 1411 1411 static int inst; 1412 1412 struct device_node *dp = op->dev.of_node; ··· 1543 1543 }; 1544 1544 MODULE_DEVICE_TABLE(of, su_match); 1545 1545 1546 - static struct of_platform_driver su_driver = { 1546 + static struct platform_driver su_driver = { 1547 1547 .driver = { 1548 1548 .name = "su", 1549 1549 .owner = THIS_MODULE, ··· 1586 1586 return err; 1587 1587 } 1588 1588 1589 - err = of_register_platform_driver(&su_driver); 1589 + err = platform_driver_register(&su_driver); 1590 1590 if (err && num_uart) 1591 1591 sunserial_unregister_minors(&sunsu_reg, num_uart); 1592 1592
+5 -5
drivers/tty/serial/sunzilog.c
··· 1399 1399 1400 1400 static int zilog_irq = -1; 1401 1401 1402 - static int __devinit zs_probe(struct platform_device *op, const struct of_device_id *match) 1402 + static int __devinit zs_probe(struct platform_device *op) 1403 1403 { 1404 1404 static int kbm_inst, uart_inst; 1405 1405 int inst; ··· 1540 1540 }; 1541 1541 MODULE_DEVICE_TABLE(of, zs_match); 1542 1542 1543 - static struct of_platform_driver zs_driver = { 1543 + static struct platform_driver zs_driver = { 1544 1544 .driver = { 1545 1545 .name = "zs", 1546 1546 .owner = THIS_MODULE, ··· 1576 1576 goto out_free_tables; 1577 1577 } 1578 1578 1579 - err = of_register_platform_driver(&zs_driver); 1579 + err = platform_driver_register(&zs_driver); 1580 1580 if (err) 1581 1581 goto out_unregister_uart; 1582 1582 ··· 1604 1604 return err; 1605 1605 1606 1606 out_unregister_driver: 1607 - of_unregister_platform_driver(&zs_driver); 1607 + platform_driver_unregister(&zs_driver); 1608 1608 1609 1609 out_unregister_uart: 1610 1610 if (num_sunzilog) { ··· 1619 1619 1620 1620 static void __exit sunzilog_exit(void) 1621 1621 { 1622 - of_unregister_platform_driver(&zs_driver); 1622 + platform_driver_unregister(&zs_driver); 1623 1623 1624 1624 if (zilog_irq != -1) { 1625 1625 struct uart_sunzilog_port *up = sunzilog_irq_chain;
+24 -79
drivers/tty/serial/uartlite.c
··· 19 19 #include <linux/interrupt.h> 20 20 #include <linux/init.h> 21 21 #include <asm/io.h> 22 - #if defined(CONFIG_OF) && (defined(CONFIG_PPC32) || defined(CONFIG_MICROBLAZE)) 23 22 #include <linux/of.h> 24 23 #include <linux/of_address.h> 25 24 #include <linux/of_device.h> 26 25 #include <linux/of_platform.h> 27 - 28 - /* Match table for of_platform binding */ 29 - static struct of_device_id ulite_of_match[] __devinitdata = { 30 - { .compatible = "xlnx,opb-uartlite-1.00.b", }, 31 - { .compatible = "xlnx,xps-uartlite-1.00.a", }, 32 - {} 33 - }; 34 - MODULE_DEVICE_TABLE(of, ulite_of_match); 35 - 36 - #endif 37 26 38 27 #define ULITE_NAME "ttyUL" 39 28 #define ULITE_MAJOR 204 ··· 560 571 * Platform bus binding 561 572 */ 562 573 574 + #if defined(CONFIG_OF) 575 + /* Match table for of_platform binding */ 576 + static struct of_device_id ulite_of_match[] __devinitdata = { 577 + { .compatible = "xlnx,opb-uartlite-1.00.b", }, 578 + { .compatible = "xlnx,xps-uartlite-1.00.a", }, 579 + {} 580 + }; 581 + MODULE_DEVICE_TABLE(of, ulite_of_match); 582 + #else /* CONFIG_OF */ 583 + #define ulite_of_match NULL 584 + #endif /* CONFIG_OF */ 585 + 563 586 static int __devinit ulite_probe(struct platform_device *pdev) 564 587 { 565 588 struct resource *res, *res2; 589 + int id = pdev->id; 590 + #ifdef CONFIG_OF 591 + const __be32 *prop; 592 + 593 + prop = of_get_property(pdev->dev.of_node, "port-number", NULL); 594 + if (prop) 595 + id = be32_to_cpup(prop); 596 + #endif 566 597 567 598 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 568 599 if (!res) ··· 592 583 if (!res2) 593 584 return -ENODEV; 594 585 595 - return ulite_assign(&pdev->dev, pdev->id, res->start, res2->start); 586 + return ulite_assign(&pdev->dev, id, res->start, res2->start); 596 587 } 597 588 598 589 static int __devexit ulite_remove(struct platform_device *pdev) ··· 604 595 MODULE_ALIAS("platform:uartlite"); 605 596 606 597 static struct platform_driver ulite_platform_driver = { 607 - .probe = ulite_probe, 608 - .remove = __devexit_p(ulite_remove), 609 - .driver = { 610 - .owner = THIS_MODULE, 611 - .name = "uartlite", 612 - }, 613 - }; 614 - 615 - /* --------------------------------------------------------------------- 616 - * OF bus bindings 617 - */ 618 - #if defined(CONFIG_OF) && (defined(CONFIG_PPC32) || defined(CONFIG_MICROBLAZE)) 619 - static int __devinit 620 - ulite_of_probe(struct platform_device *op, const struct of_device_id *match) 621 - { 622 - struct resource res; 623 - const unsigned int *id; 624 - int irq, rc; 625 - 626 - dev_dbg(&op->dev, "%s(%p, %p)\n", __func__, op, match); 627 - 628 - rc = of_address_to_resource(op->dev.of_node, 0, &res); 629 - if (rc) { 630 - dev_err(&op->dev, "invalid address\n"); 631 - return rc; 632 - } 633 - 634 - irq = irq_of_parse_and_map(op->dev.of_node, 0); 635 - 636 - id = of_get_property(op->dev.of_node, "port-number", NULL); 637 - 638 - return ulite_assign(&op->dev, id ? *id : -1, res.start, irq); 639 - } 640 - 641 - static int __devexit ulite_of_remove(struct platform_device *op) 642 - { 643 - return ulite_release(&op->dev); 644 - } 645 - 646 - static struct of_platform_driver ulite_of_driver = { 647 - .probe = ulite_of_probe, 648 - .remove = __devexit_p(ulite_of_remove), 598 + .probe = ulite_probe, 599 + .remove = __devexit_p(ulite_remove), 649 600 .driver = { 650 - .name = "uartlite", 651 601 .owner = THIS_MODULE, 602 + .name = "uartlite", 652 603 .of_match_table = ulite_of_match, 653 604 }, 654 605 }; 655 - 656 - /* Registration helpers to keep the number of #ifdefs to a minimum */ 657 - static inline int __init ulite_of_register(void) 658 - { 659 - pr_debug("uartlite: calling of_register_platform_driver()\n"); 660 - return of_register_platform_driver(&ulite_of_driver); 661 - } 662 - 663 - static inline void __exit ulite_of_unregister(void) 664 - { 665 - of_unregister_platform_driver(&ulite_of_driver); 666 - } 667 - #else /* CONFIG_OF && (CONFIG_PPC32 || CONFIG_MICROBLAZE) */ 668 - /* Appropriate config not enabled; do nothing helpers */ 669 - static inline int __init ulite_of_register(void) { return 0; } 670 - static inline void __exit ulite_of_unregister(void) { } 671 - #endif /* CONFIG_OF && (CONFIG_PPC32 || CONFIG_MICROBLAZE) */ 672 606 673 607 /* --------------------------------------------------------------------- 674 608 * Module setup/teardown ··· 626 674 if (ret) 627 675 goto err_uart; 628 676 629 - ret = ulite_of_register(); 630 - if (ret) 631 - goto err_of; 632 - 633 677 pr_debug("uartlite: calling platform_driver_register()\n"); 634 678 ret = platform_driver_register(&ulite_platform_driver); 635 679 if (ret) ··· 634 686 return 0; 635 687 636 688 err_plat: 637 - ulite_of_unregister(); 638 - err_of: 639 689 uart_unregister_driver(&ulite_uart_driver); 640 690 err_uart: 641 691 printk(KERN_ERR "registering uartlite driver failed: err=%i", ret); ··· 643 697 void __exit ulite_exit(void) 644 698 { 645 699 platform_driver_unregister(&ulite_platform_driver); 646 - ulite_of_unregister(); 647 700 uart_unregister_driver(&ulite_uart_driver); 648 701 } 649 702
+4 -5
drivers/tty/serial/ucc_uart.c
··· 1194 1194 release_firmware(fw); 1195 1195 } 1196 1196 1197 - static int ucc_uart_probe(struct platform_device *ofdev, 1198 - const struct of_device_id *match) 1197 + static int ucc_uart_probe(struct platform_device *ofdev) 1199 1198 { 1200 1199 struct device_node *np = ofdev->dev.of_node; 1201 1200 const unsigned int *iprop; /* Integer OF properties */ ··· 1484 1485 }; 1485 1486 MODULE_DEVICE_TABLE(of, ucc_uart_match); 1486 1487 1487 - static struct of_platform_driver ucc_uart_of_driver = { 1488 + static struct platform_driver ucc_uart_of_driver = { 1488 1489 .driver = { 1489 1490 .name = "ucc_uart", 1490 1491 .owner = THIS_MODULE, ··· 1509 1510 return ret; 1510 1511 } 1511 1512 1512 - ret = of_register_platform_driver(&ucc_uart_of_driver); 1513 + ret = platform_driver_register(&ucc_uart_of_driver); 1513 1514 if (ret) 1514 1515 printk(KERN_ERR 1515 1516 "ucc-uart: could not register platform driver\n"); ··· 1522 1523 printk(KERN_INFO 1523 1524 "Freescale QUICC Engine UART device driver unloading\n"); 1524 1525 1525 - of_unregister_platform_driver(&ucc_uart_of_driver); 1526 + platform_driver_unregister(&ucc_uart_of_driver); 1526 1527 uart_unregister_driver(&ucc_uart_driver); 1527 1528 } 1528 1529
+8 -6
drivers/usb/gadget/fsl_qe_udc.c
··· 2523 2523 } 2524 2524 2525 2525 /* Driver probe functions */ 2526 - static int __devinit qe_udc_probe(struct platform_device *ofdev, 2527 - const struct of_device_id *match) 2526 + static int __devinit qe_udc_probe(struct platform_device *ofdev) 2528 2527 { 2529 2528 struct device_node *np = ofdev->dev.of_node; 2530 2529 struct qe_ep *ep; 2531 2530 unsigned int ret = 0; 2532 2531 unsigned int i; 2533 2532 const void *prop; 2533 + 2534 + if (!ofdev->dev.of_match) 2535 + return -EINVAL; 2534 2536 2535 2537 prop = of_get_property(np, "mode", NULL); 2536 2538 if (!prop || strcmp(prop, "peripheral")) ··· 2545 2543 return -ENOMEM; 2546 2544 } 2547 2545 2548 - udc_controller->soc_type = (unsigned long)match->data; 2546 + udc_controller->soc_type = (unsigned long)ofdev->dev.of_match->data; 2549 2547 udc_controller->usb_regs = of_iomap(np, 0); 2550 2548 if (!udc_controller->usb_regs) { 2551 2549 ret = -ENOMEM; ··· 2770 2768 2771 2769 MODULE_DEVICE_TABLE(of, qe_udc_match); 2772 2770 2773 - static struct of_platform_driver udc_driver = { 2771 + static struct platform_driver udc_driver = { 2774 2772 .driver = { 2775 2773 .name = (char *)driver_name, 2776 2774 .owner = THIS_MODULE, ··· 2788 2786 { 2789 2787 printk(KERN_INFO "%s: %s, %s\n", driver_name, driver_desc, 2790 2788 DRIVER_VERSION); 2791 - return of_register_platform_driver(&udc_driver); 2789 + return platform_driver_register(&udc_driver); 2792 2790 } 2793 2791 2794 2792 static void __exit qe_udc_exit(void) 2795 2793 { 2796 - of_unregister_platform_driver(&udc_driver); 2794 + platform_driver_unregister(&udc_driver); 2797 2795 } 2798 2796 2799 2797 module_init(qe_udc_init);
+6 -6
drivers/usb/host/ehci-hcd.c
··· 1317 1317 #endif 1318 1318 1319 1319 #ifdef OF_PLATFORM_DRIVER 1320 - retval = of_register_platform_driver(&OF_PLATFORM_DRIVER); 1320 + retval = platform_driver_register(&OF_PLATFORM_DRIVER); 1321 1321 if (retval < 0) 1322 1322 goto clean3; 1323 1323 #endif 1324 1324 1325 1325 #ifdef XILINX_OF_PLATFORM_DRIVER 1326 - retval = of_register_platform_driver(&XILINX_OF_PLATFORM_DRIVER); 1326 + retval = platform_driver_register(&XILINX_OF_PLATFORM_DRIVER); 1327 1327 if (retval < 0) 1328 1328 goto clean4; 1329 1329 #endif 1330 1330 return retval; 1331 1331 1332 1332 #ifdef XILINX_OF_PLATFORM_DRIVER 1333 - /* of_unregister_platform_driver(&XILINX_OF_PLATFORM_DRIVER); */ 1333 + /* platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER); */ 1334 1334 clean4: 1335 1335 #endif 1336 1336 #ifdef OF_PLATFORM_DRIVER 1337 - of_unregister_platform_driver(&OF_PLATFORM_DRIVER); 1337 + platform_driver_unregister(&OF_PLATFORM_DRIVER); 1338 1338 clean3: 1339 1339 #endif 1340 1340 #ifdef PS3_SYSTEM_BUS_DRIVER ··· 1362 1362 static void __exit ehci_hcd_cleanup(void) 1363 1363 { 1364 1364 #ifdef XILINX_OF_PLATFORM_DRIVER 1365 - of_unregister_platform_driver(&XILINX_OF_PLATFORM_DRIVER); 1365 + platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER); 1366 1366 #endif 1367 1367 #ifdef OF_PLATFORM_DRIVER 1368 - of_unregister_platform_driver(&OF_PLATFORM_DRIVER); 1368 + platform_driver_unregister(&OF_PLATFORM_DRIVER); 1369 1369 #endif 1370 1370 #ifdef PLATFORM_DRIVER 1371 1371 platform_driver_unregister(&PLATFORM_DRIVER);
+3 -6
drivers/usb/host/ehci-ppc-of.c
··· 105 105 } 106 106 107 107 108 - static int __devinit 109 - ehci_hcd_ppc_of_probe(struct platform_device *op, const struct of_device_id *match) 108 + static int __devinit ehci_hcd_ppc_of_probe(struct platform_device *op) 110 109 { 111 110 struct device_node *dn = op->dev.of_node; 112 111 struct usb_hcd *hcd; ··· 254 255 } 255 256 256 257 257 - static int ehci_hcd_ppc_of_shutdown(struct platform_device *op) 258 + static void ehci_hcd_ppc_of_shutdown(struct platform_device *op) 258 259 { 259 260 struct usb_hcd *hcd = dev_get_drvdata(&op->dev); 260 261 261 262 if (hcd->driver->shutdown) 262 263 hcd->driver->shutdown(hcd); 263 - 264 - return 0; 265 264 } 266 265 267 266 ··· 272 275 MODULE_DEVICE_TABLE(of, ehci_hcd_ppc_of_match); 273 276 274 277 275 - static struct of_platform_driver ehci_hcd_ppc_of_driver = { 278 + static struct platform_driver ehci_hcd_ppc_of_driver = { 276 279 .probe = ehci_hcd_ppc_of_probe, 277 280 .remove = ehci_hcd_ppc_of_remove, 278 281 .shutdown = ehci_hcd_ppc_of_shutdown,
+2 -4
drivers/usb/host/ehci-xilinx-of.c
··· 143 143 /** 144 144 * ehci_hcd_xilinx_of_probe - Probe method for the USB host controller 145 145 * @op: pointer to the platform_device bound to the host controller 146 - * @match: pointer to of_device_id structure, not used 147 146 * 148 147 * This function requests resources and sets up appropriate properties for the 149 148 * host controller. Because the Xilinx USB host controller can be configured 150 149 * as HS only or HS/FS only, it checks the configuration in the device tree 151 150 * entry, and sets an appropriate value for hcd->has_tt. 152 151 */ 153 - static int __devinit 154 - ehci_hcd_xilinx_of_probe(struct platform_device *op, const struct of_device_id *match) 152 + static int __devinit ehci_hcd_xilinx_of_probe(struct platform_device *op) 155 153 { 156 154 struct device_node *dn = op->dev.of_node; 157 155 struct usb_hcd *hcd; ··· 287 289 }; 288 290 MODULE_DEVICE_TABLE(of, ehci_hcd_xilinx_of_match); 289 291 290 - static struct of_platform_driver ehci_hcd_xilinx_of_driver = { 292 + static struct platform_driver ehci_hcd_xilinx_of_driver = { 291 293 .probe = ehci_hcd_xilinx_of_probe, 292 294 .remove = ehci_hcd_xilinx_of_remove, 293 295 .shutdown = ehci_hcd_xilinx_of_shutdown,
+4 -5
drivers/usb/host/fhci-hcd.c
··· 561 561 .hub_control = fhci_hub_control, 562 562 }; 563 563 564 - static int __devinit of_fhci_probe(struct platform_device *ofdev, 565 - const struct of_device_id *ofid) 564 + static int __devinit of_fhci_probe(struct platform_device *ofdev) 566 565 { 567 566 struct device *dev = &ofdev->dev; 568 567 struct device_node *node = dev->of_node; ··· 811 812 }; 812 813 MODULE_DEVICE_TABLE(of, of_fhci_match); 813 814 814 - static struct of_platform_driver of_fhci_driver = { 815 + static struct platform_driver of_fhci_driver = { 815 816 .driver = { 816 817 .name = "fsl,usb-fhci", 817 818 .owner = THIS_MODULE, ··· 823 824 824 825 static int __init fhci_module_init(void) 825 826 { 826 - return of_register_platform_driver(&of_fhci_driver); 827 + return platform_driver_register(&of_fhci_driver); 827 828 } 828 829 module_init(fhci_module_init); 829 830 830 831 static void __exit fhci_module_exit(void) 831 832 { 832 - of_unregister_platform_driver(&of_fhci_driver); 833 + platform_driver_unregister(&of_fhci_driver); 833 834 } 834 835 module_exit(fhci_module_exit); 835 836
+4 -5
drivers/usb/host/isp1760-if.c
··· 27 27 #endif 28 28 29 29 #ifdef CONFIG_PPC_OF 30 - static int of_isp1760_probe(struct platform_device *dev, 31 - const struct of_device_id *match) 30 + static int of_isp1760_probe(struct platform_device *dev) 32 31 { 33 32 struct usb_hcd *hcd; 34 33 struct device_node *dp = dev->dev.of_node; ··· 118 119 }; 119 120 MODULE_DEVICE_TABLE(of, of_isp1760_match); 120 121 121 - static struct of_platform_driver isp1760_of_driver = { 122 + static struct platform_driver isp1760_of_driver = { 122 123 .driver = { 123 124 .name = "nxp-isp1760", 124 125 .owner = THIS_MODULE, ··· 397 398 if (!ret) 398 399 any_ret = 0; 399 400 #ifdef CONFIG_PPC_OF 400 - ret = of_register_platform_driver(&isp1760_of_driver); 401 + ret = platform_driver_register(&isp1760_of_driver); 401 402 if (!ret) 402 403 any_ret = 0; 403 404 #endif ··· 417 418 { 418 419 platform_driver_unregister(&isp1760_plat_driver); 419 420 #ifdef CONFIG_PPC_OF 420 - of_unregister_platform_driver(&isp1760_of_driver); 421 + platform_driver_unregister(&isp1760_of_driver); 421 422 #endif 422 423 #ifdef CONFIG_PCI 423 424 pci_unregister_driver(&isp1761_pci_driver);
+3 -3
drivers/usb/host/ohci-hcd.c
··· 1168 1168 #endif 1169 1169 1170 1170 #ifdef OF_PLATFORM_DRIVER 1171 - retval = of_register_platform_driver(&OF_PLATFORM_DRIVER); 1171 + retval = platform_driver_register(&OF_PLATFORM_DRIVER); 1172 1172 if (retval < 0) 1173 1173 goto error_of_platform; 1174 1174 #endif ··· 1227 1227 error_sa1111: 1228 1228 #endif 1229 1229 #ifdef OF_PLATFORM_DRIVER 1230 - of_unregister_platform_driver(&OF_PLATFORM_DRIVER); 1230 + platform_driver_unregister(&OF_PLATFORM_DRIVER); 1231 1231 error_of_platform: 1232 1232 #endif 1233 1233 #ifdef PLATFORM_DRIVER ··· 1275 1275 sa1111_driver_unregister(&SA1111_DRIVER); 1276 1276 #endif 1277 1277 #ifdef OF_PLATFORM_DRIVER 1278 - of_unregister_platform_driver(&OF_PLATFORM_DRIVER); 1278 + platform_driver_unregister(&OF_PLATFORM_DRIVER); 1279 1279 #endif 1280 1280 #ifdef PLATFORM_DRIVER 1281 1281 platform_driver_unregister(&PLATFORM_DRIVER);
+3 -6
drivers/usb/host/ohci-ppc-of.c
··· 80 80 }; 81 81 82 82 83 - static int __devinit 84 - ohci_hcd_ppc_of_probe(struct platform_device *op, const struct of_device_id *match) 83 + static int __devinit ohci_hcd_ppc_of_probe(struct platform_device *op) 85 84 { 86 85 struct device_node *dn = op->dev.of_node; 87 86 struct usb_hcd *hcd; ··· 200 201 return 0; 201 202 } 202 203 203 - static int ohci_hcd_ppc_of_shutdown(struct platform_device *op) 204 + static void ohci_hcd_ppc_of_shutdown(struct platform_device *op) 204 205 { 205 206 struct usb_hcd *hcd = dev_get_drvdata(&op->dev); 206 207 207 208 if (hcd->driver->shutdown) 208 209 hcd->driver->shutdown(hcd); 209 - 210 - return 0; 211 210 } 212 211 213 212 ··· 240 243 #endif 241 244 242 245 243 - static struct of_platform_driver ohci_hcd_ppc_of_driver = { 246 + static struct platform_driver ohci_hcd_ppc_of_driver = { 244 247 .probe = ohci_hcd_ppc_of_probe, 245 248 .remove = ohci_hcd_ppc_of_remove, 246 249 .shutdown = ohci_hcd_ppc_of_shutdown,
+4 -4
drivers/video/bw2.c
··· 273 273 return 0; 274 274 } 275 275 276 - static int __devinit bw2_probe(struct platform_device *op, const struct of_device_id *match) 276 + static int __devinit bw2_probe(struct platform_device *op) 277 277 { 278 278 struct device_node *dp = op->dev.of_node; 279 279 struct fb_info *info; ··· 375 375 }; 376 376 MODULE_DEVICE_TABLE(of, bw2_match); 377 377 378 - static struct of_platform_driver bw2_driver = { 378 + static struct platform_driver bw2_driver = { 379 379 .driver = { 380 380 .name = "bw2", 381 381 .owner = THIS_MODULE, ··· 390 390 if (fb_get_options("bw2fb", NULL)) 391 391 return -ENODEV; 392 392 393 - return of_register_platform_driver(&bw2_driver); 393 + return platform_driver_register(&bw2_driver); 394 394 } 395 395 396 396 static void __exit bw2_exit(void) 397 397 { 398 - of_unregister_platform_driver(&bw2_driver); 398 + platform_driver_unregister(&bw2_driver); 399 399 } 400 400 401 401 module_init(bw2_init);
+4 -4
drivers/video/cg14.c
··· 463 463 info->screen_base, info->fix.smem_len); 464 464 } 465 465 466 - static int __devinit cg14_probe(struct platform_device *op, const struct of_device_id *match) 466 + static int __devinit cg14_probe(struct platform_device *op) 467 467 { 468 468 struct device_node *dp = op->dev.of_node; 469 469 struct fb_info *info; ··· 595 595 }; 596 596 MODULE_DEVICE_TABLE(of, cg14_match); 597 597 598 - static struct of_platform_driver cg14_driver = { 598 + static struct platform_driver cg14_driver = { 599 599 .driver = { 600 600 .name = "cg14", 601 601 .owner = THIS_MODULE, ··· 610 610 if (fb_get_options("cg14fb", NULL)) 611 611 return -ENODEV; 612 612 613 - return of_register_platform_driver(&cg14_driver); 613 + return platform_driver_register(&cg14_driver); 614 614 } 615 615 616 616 static void __exit cg14_exit(void) 617 617 { 618 - of_unregister_platform_driver(&cg14_driver); 618 + platform_driver_unregister(&cg14_driver); 619 619 } 620 620 621 621 module_init(cg14_init);
+4 -5
drivers/video/cg3.c
··· 346 346 return 0; 347 347 } 348 348 349 - static int __devinit cg3_probe(struct platform_device *op, 350 - const struct of_device_id *match) 349 + static int __devinit cg3_probe(struct platform_device *op) 351 350 { 352 351 struct device_node *dp = op->dev.of_node; 353 352 struct fb_info *info; ··· 461 462 }; 462 463 MODULE_DEVICE_TABLE(of, cg3_match); 463 464 464 - static struct of_platform_driver cg3_driver = { 465 + static struct platform_driver cg3_driver = { 465 466 .driver = { 466 467 .name = "cg3", 467 468 .owner = THIS_MODULE, ··· 476 477 if (fb_get_options("cg3fb", NULL)) 477 478 return -ENODEV; 478 479 479 - return of_register_platform_driver(&cg3_driver); 480 + return platform_driver_register(&cg3_driver); 480 481 } 481 482 482 483 static void __exit cg3_exit(void) 483 484 { 484 - of_unregister_platform_driver(&cg3_driver); 485 + platform_driver_unregister(&cg3_driver); 485 486 } 486 487 487 488 module_init(cg3_init);
+4 -5
drivers/video/cg6.c
··· 737 737 info->fix.smem_len); 738 738 } 739 739 740 - static int __devinit cg6_probe(struct platform_device *op, 741 - const struct of_device_id *match) 740 + static int __devinit cg6_probe(struct platform_device *op) 742 741 { 743 742 struct device_node *dp = op->dev.of_node; 744 743 struct fb_info *info; ··· 854 855 }; 855 856 MODULE_DEVICE_TABLE(of, cg6_match); 856 857 857 - static struct of_platform_driver cg6_driver = { 858 + static struct platform_driver cg6_driver = { 858 859 .driver = { 859 860 .name = "cg6", 860 861 .owner = THIS_MODULE, ··· 869 870 if (fb_get_options("cg6fb", NULL)) 870 871 return -ENODEV; 871 872 872 - return of_register_platform_driver(&cg6_driver); 873 + return platform_driver_register(&cg6_driver); 873 874 } 874 875 875 876 static void __exit cg6_exit(void) 876 877 { 877 - of_unregister_platform_driver(&cg6_driver); 878 + platform_driver_unregister(&cg6_driver); 878 879 } 879 880 880 881 module_init(cg6_init);
+4 -5
drivers/video/ffb.c
··· 893 893 info->fix.accel = FB_ACCEL_SUN_CREATOR; 894 894 } 895 895 896 - static int __devinit ffb_probe(struct platform_device *op, 897 - const struct of_device_id *match) 896 + static int __devinit ffb_probe(struct platform_device *op) 898 897 { 899 898 struct device_node *dp = op->dev.of_node; 900 899 struct ffb_fbc __iomem *fbc; ··· 1051 1052 }; 1052 1053 MODULE_DEVICE_TABLE(of, ffb_match); 1053 1054 1054 - static struct of_platform_driver ffb_driver = { 1055 + static struct platform_driver ffb_driver = { 1055 1056 .driver = { 1056 1057 .name = "ffb", 1057 1058 .owner = THIS_MODULE, ··· 1066 1067 if (fb_get_options("ffb", NULL)) 1067 1068 return -ENODEV; 1068 1069 1069 - return of_register_platform_driver(&ffb_driver); 1070 + return platform_driver_register(&ffb_driver); 1070 1071 } 1071 1072 1072 1073 static void __exit ffb_exit(void) 1073 1074 { 1074 - of_unregister_platform_driver(&ffb_driver); 1075 + platform_driver_unregister(&ffb_driver); 1075 1076 } 1076 1077 1077 1078 module_init(ffb_init);
+4 -5
drivers/video/fsl-diu-fb.c
··· 1487 1487 return diu_ops.show_monitor_port(machine_data->monitor_port, buf); 1488 1488 } 1489 1489 1490 - static int __devinit fsl_diu_probe(struct platform_device *ofdev, 1491 - const struct of_device_id *match) 1490 + static int __devinit fsl_diu_probe(struct platform_device *ofdev) 1492 1491 { 1493 1492 struct device_node *np = ofdev->dev.of_node; 1494 1493 struct mfb_info *mfbi; ··· 1734 1735 }; 1735 1736 MODULE_DEVICE_TABLE(of, fsl_diu_match); 1736 1737 1737 - static struct of_platform_driver fsl_diu_driver = { 1738 + static struct platform_driver fsl_diu_driver = { 1738 1739 .driver = { 1739 1740 .name = "fsl_diu", 1740 1741 .owner = THIS_MODULE, ··· 1796 1797 if (!coherence_data) 1797 1798 return -ENOMEM; 1798 1799 #endif 1799 - ret = of_register_platform_driver(&fsl_diu_driver); 1800 + ret = platform_driver_register(&fsl_diu_driver); 1800 1801 if (ret) { 1801 1802 printk(KERN_ERR 1802 1803 "fsl-diu: failed to register platform driver\n"); ··· 1810 1811 1811 1812 static void __exit fsl_diu_exit(void) 1812 1813 { 1813 - of_unregister_platform_driver(&fsl_diu_driver); 1814 + platform_driver_unregister(&fsl_diu_driver); 1814 1815 #if defined(CONFIG_NOT_COHERENT_CACHE) 1815 1816 vfree(coherence_data); 1816 1817 #endif
+4 -5
drivers/video/leo.c
··· 547 547 of_iounmap(&op->resource[0], info->screen_base, 0x800000); 548 548 } 549 549 550 - static int __devinit leo_probe(struct platform_device *op, 551 - const struct of_device_id *match) 550 + static int __devinit leo_probe(struct platform_device *op) 552 551 { 553 552 struct device_node *dp = op->dev.of_node; 554 553 struct fb_info *info; ··· 661 662 }; 662 663 MODULE_DEVICE_TABLE(of, leo_match); 663 664 664 - static struct of_platform_driver leo_driver = { 665 + static struct platform_driver leo_driver = { 665 666 .driver = { 666 667 .name = "leo", 667 668 .owner = THIS_MODULE, ··· 676 677 if (fb_get_options("leofb", NULL)) 677 678 return -ENODEV; 678 679 679 - return of_register_platform_driver(&leo_driver); 680 + return platform_driver_register(&leo_driver); 680 681 } 681 682 682 683 static void __exit leo_exit(void) 683 684 { 684 - of_unregister_platform_driver(&leo_driver); 685 + platform_driver_unregister(&leo_driver); 685 686 } 686 687 687 688 module_init(leo_init);
+4 -5
drivers/video/mb862xx/mb862xxfb.c
··· 550 550 return 0; 551 551 } 552 552 553 - static int __devinit of_platform_mb862xx_probe(struct platform_device *ofdev, 554 - const struct of_device_id *id) 553 + static int __devinit of_platform_mb862xx_probe(struct platform_device *ofdev) 555 554 { 556 555 struct device_node *np = ofdev->dev.of_node; 557 556 struct device *dev = &ofdev->dev; ··· 716 717 { /* end */ } 717 718 }; 718 719 719 - static struct of_platform_driver of_platform_mb862xxfb_driver = { 720 + static struct platform_driver of_platform_mb862xxfb_driver = { 720 721 .driver = { 721 722 .name = DRV_NAME, 722 723 .owner = THIS_MODULE, ··· 1037 1038 int ret = -ENODEV; 1038 1039 1039 1040 #if defined(CONFIG_FB_MB862XX_LIME) 1040 - ret = of_register_platform_driver(&of_platform_mb862xxfb_driver); 1041 + ret = platform_driver_register(&of_platform_mb862xxfb_driver); 1041 1042 #endif 1042 1043 #if defined(CONFIG_FB_MB862XX_PCI_GDC) 1043 1044 ret = pci_register_driver(&mb862xxfb_pci_driver); ··· 1048 1049 static void __exit mb862xxfb_exit(void) 1049 1050 { 1050 1051 #if defined(CONFIG_FB_MB862XX_LIME) 1051 - of_unregister_platform_driver(&of_platform_mb862xxfb_driver); 1052 + platform_driver_unregister(&of_platform_mb862xxfb_driver); 1052 1053 #endif 1053 1054 #if defined(CONFIG_FB_MB862XX_PCI_GDC) 1054 1055 pci_unregister_driver(&mb862xxfb_pci_driver);
+4 -4
drivers/video/p9100.c
··· 249 249 info->fix.accel = FB_ACCEL_SUN_CGTHREE; 250 250 } 251 251 252 - static int __devinit p9100_probe(struct platform_device *op, const struct of_device_id *match) 252 + static int __devinit p9100_probe(struct platform_device *op) 253 253 { 254 254 struct device_node *dp = op->dev.of_node; 255 255 struct fb_info *info; ··· 352 352 }; 353 353 MODULE_DEVICE_TABLE(of, p9100_match); 354 354 355 - static struct of_platform_driver p9100_driver = { 355 + static struct platform_driver p9100_driver = { 356 356 .driver = { 357 357 .name = "p9100", 358 358 .owner = THIS_MODULE, ··· 367 367 if (fb_get_options("p9100fb", NULL)) 368 368 return -ENODEV; 369 369 370 - return of_register_platform_driver(&p9100_driver); 370 + return platform_driver_register(&p9100_driver); 371 371 } 372 372 373 373 static void __exit p9100_exit(void) 374 374 { 375 - of_unregister_platform_driver(&p9100_driver); 375 + platform_driver_unregister(&p9100_driver); 376 376 } 377 377 378 378 module_init(p9100_init);
+4 -5
drivers/video/platinumfb.c
··· 533 533 #define invalidate_cache(addr) 534 534 #endif 535 535 536 - static int __devinit platinumfb_probe(struct platform_device* odev, 537 - const struct of_device_id *match) 536 + static int __devinit platinumfb_probe(struct platform_device* odev) 538 537 { 539 538 struct device_node *dp = odev->dev.of_node; 540 539 struct fb_info *info; ··· 676 677 {}, 677 678 }; 678 679 679 - static struct of_platform_driver platinum_driver = 680 + static struct platform_driver platinum_driver = 680 681 { 681 682 .driver = { 682 683 .name = "platinumfb", ··· 696 697 return -ENODEV; 697 698 platinumfb_setup(option); 698 699 #endif 699 - of_register_platform_driver(&platinum_driver); 700 + platform_driver_register(&platinum_driver); 700 701 701 702 return 0; 702 703 } 703 704 704 705 static void __exit platinumfb_exit(void) 705 706 { 706 - of_unregister_platform_driver(&platinum_driver); 707 + platform_driver_unregister(&platinum_driver); 707 708 } 708 709 709 710 MODULE_LICENSE("GPL");
+4 -5
drivers/video/sunxvr1000.c
··· 111 111 return 0; 112 112 } 113 113 114 - static int __devinit gfb_probe(struct platform_device *op, 115 - const struct of_device_id *match) 114 + static int __devinit gfb_probe(struct platform_device *op) 116 115 { 117 116 struct device_node *dp = op->dev.of_node; 118 117 struct fb_info *info; ··· 197 198 }; 198 199 MODULE_DEVICE_TABLE(of, ffb_match); 199 200 200 - static struct of_platform_driver gfb_driver = { 201 + static struct platform_driver gfb_driver = { 201 202 .probe = gfb_probe, 202 203 .remove = __devexit_p(gfb_remove), 203 204 .driver = { ··· 212 213 if (fb_get_options("gfb", NULL)) 213 214 return -ENODEV; 214 215 215 - return of_register_platform_driver(&gfb_driver); 216 + return platform_driver_register(&gfb_driver); 216 217 } 217 218 218 219 static void __exit gfb_exit(void) 219 220 { 220 - of_unregister_platform_driver(&gfb_driver); 221 + platform_driver_unregister(&gfb_driver); 221 222 } 222 223 223 224 module_init(gfb_init);
+4 -5
drivers/video/tcx.c
··· 362 362 info->screen_base, info->fix.smem_len); 363 363 } 364 364 365 - static int __devinit tcx_probe(struct platform_device *op, 366 - const struct of_device_id *match) 365 + static int __devinit tcx_probe(struct platform_device *op) 367 366 { 368 367 struct device_node *dp = op->dev.of_node; 369 368 struct fb_info *info; ··· 510 511 }; 511 512 MODULE_DEVICE_TABLE(of, tcx_match); 512 513 513 - static struct of_platform_driver tcx_driver = { 514 + static struct platform_driver tcx_driver = { 514 515 .driver = { 515 516 .name = "tcx", 516 517 .owner = THIS_MODULE, ··· 525 526 if (fb_get_options("tcxfb", NULL)) 526 527 return -ENODEV; 527 528 528 - return of_register_platform_driver(&tcx_driver); 529 + return platform_driver_register(&tcx_driver); 529 530 } 530 531 531 532 static void __exit tcx_exit(void) 532 533 { 533 - of_unregister_platform_driver(&tcx_driver); 534 + platform_driver_unregister(&tcx_driver); 534 535 } 535 536 536 537 module_init(tcx_init);
+4 -7
drivers/video/xilinxfb.c
··· 404 404 * OF bus binding 405 405 */ 406 406 407 - static int __devinit 408 - xilinxfb_of_probe(struct platform_device *op, const struct of_device_id *match) 407 + static int __devinit xilinxfb_of_probe(struct platform_device *op) 409 408 { 410 409 const u32 *prop; 411 410 u32 *p; ··· 416 417 417 418 /* Copy with the default pdata (not a ptr reference!) */ 418 419 pdata = xilinx_fb_default_pdata; 419 - 420 - dev_dbg(&op->dev, "xilinxfb_of_probe(%p, %p)\n", op, match); 421 420 422 421 /* Allocate the driver data region */ 423 422 drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); ··· 502 505 }; 503 506 MODULE_DEVICE_TABLE(of, xilinxfb_of_match); 504 507 505 - static struct of_platform_driver xilinxfb_of_driver = { 508 + static struct platform_driver xilinxfb_of_driver = { 506 509 .probe = xilinxfb_of_probe, 507 510 .remove = __devexit_p(xilinxfb_of_remove), 508 511 .driver = { ··· 520 523 static int __init 521 524 xilinxfb_init(void) 522 525 { 523 - return of_register_platform_driver(&xilinxfb_of_driver); 526 + return platform_driver_register(&xilinxfb_of_driver); 524 527 } 525 528 526 529 static void __exit 527 530 xilinxfb_cleanup(void) 528 531 { 529 - of_unregister_platform_driver(&xilinxfb_of_driver); 532 + platform_driver_unregister(&xilinxfb_of_driver); 530 533 } 531 534 532 535 module_init(xilinxfb_init);
+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);
+1
include/linux/device.h
··· 442 442 struct dev_archdata archdata; 443 443 444 444 struct device_node *of_node; /* associated device tree node */ 445 + const struct of_device_id *of_match; /* matching of_device_id from driver */ 445 446 446 447 dev_t devt; /* dev_t, creates the sysfs "dev" */ 447 448
+1 -1
include/linux/of.h
··· 108 108 #endif 109 109 110 110 /* 111 - * OF address retreival & translation 111 + * OF address retrieval & translation 112 112 */ 113 113 114 114 /* Helper to read a big number; size is in cells (not bytes) */
+3 -2
include/linux/of_device.h
··· 18 18 * @drv: the device_driver structure to test 19 19 * @dev: the device structure to match against 20 20 */ 21 - static inline int of_driver_match_device(const struct device *dev, 21 + static inline int of_driver_match_device(struct device *dev, 22 22 const struct device_driver *drv) 23 23 { 24 - return of_match_device(drv->of_match_table, dev) != NULL; 24 + dev->of_match = of_match_device(drv->of_match_table, dev); 25 + return dev->of_match != NULL; 25 26 } 26 27 27 28 extern struct platform_device *of_dev_get(struct platform_device *dev);
+1 -17
include/linux/of_platform.h
··· 23 23 * of_platform_driver - Legacy of-aware driver for platform devices. 24 24 * 25 25 * An of_platform_driver driver is attached to a basic platform_device on 26 - * ether the "platform bus" (platform_bus_type), or the ibm ebus 27 - * (ibmebus_bus_type). 28 - * 29 - * of_platform_driver is being phased out when used with the platform_bus_type, 30 - * and regular platform_drivers should be used instead. When the transition 31 - * is complete, only ibmebus will be using this structure, and the 32 - * platform_driver member of this structure will be removed. 26 + * the ibm ebus (ibmebus_bus_type). 33 27 */ 34 28 struct of_platform_driver 35 29 { ··· 36 42 int (*shutdown)(struct platform_device* dev); 37 43 38 44 struct device_driver driver; 39 - struct platform_driver platform_driver; 40 45 }; 41 46 #define to_of_platform_driver(drv) \ 42 47 container_of(drv,struct of_platform_driver, driver) 43 48 44 - extern int of_register_driver(struct of_platform_driver *drv, 45 - struct bus_type *bus); 46 - extern void of_unregister_driver(struct of_platform_driver *drv); 47 - 48 49 /* Platform drivers register/unregister */ 49 - extern int of_register_platform_driver(struct of_platform_driver *drv); 50 - extern void of_unregister_platform_driver(struct of_platform_driver *drv); 51 - 52 50 extern struct platform_device *of_device_alloc(struct device_node *np, 53 51 const char *bus_id, 54 52 struct device *parent); 55 53 extern struct platform_device *of_find_device_by_node(struct device_node *np); 56 - 57 - extern int of_bus_type_init(struct bus_type *bus, const char *name); 58 54 59 55 #if !defined(CONFIG_SPARC) /* SPARC has its own device registration method */ 60 56 /* Platform devices and busses creation */
+4 -5
sound/soc/fsl/fsl_dma.c
··· 896 896 .pointer = fsl_dma_pointer, 897 897 }; 898 898 899 - static int __devinit fsl_soc_dma_probe(struct platform_device *pdev, 900 - const struct of_device_id *match) 899 + static int __devinit fsl_soc_dma_probe(struct platform_device *pdev) 901 900 { 902 901 struct dma_object *dma; 903 902 struct device_node *np = pdev->dev.of_node; ··· 978 979 }; 979 980 MODULE_DEVICE_TABLE(of, fsl_soc_dma_ids); 980 981 981 - static struct of_platform_driver fsl_soc_dma_driver = { 982 + static struct platform_driver fsl_soc_dma_driver = { 982 983 .driver = { 983 984 .name = "fsl-pcm-audio", 984 985 .owner = THIS_MODULE, ··· 992 993 { 993 994 pr_info("Freescale Elo DMA ASoC PCM Driver\n"); 994 995 995 - return of_register_platform_driver(&fsl_soc_dma_driver); 996 + return platform_driver_register(&fsl_soc_dma_driver); 996 997 } 997 998 998 999 static void __exit fsl_soc_dma_exit(void) 999 1000 { 1000 - of_unregister_platform_driver(&fsl_soc_dma_driver); 1001 + platform_driver_unregister(&fsl_soc_dma_driver); 1001 1002 } 1002 1003 1003 1004 module_init(fsl_soc_dma_init);
+4 -5
sound/soc/fsl/fsl_ssi.c
··· 624 624 } 625 625 } 626 626 627 - static int __devinit fsl_ssi_probe(struct platform_device *pdev, 628 - const struct of_device_id *match) 627 + static int __devinit fsl_ssi_probe(struct platform_device *pdev) 629 628 { 630 629 struct fsl_ssi_private *ssi_private; 631 630 int ret = 0; ··· 773 774 }; 774 775 MODULE_DEVICE_TABLE(of, fsl_ssi_ids); 775 776 776 - static struct of_platform_driver fsl_ssi_driver = { 777 + static struct platform_driver fsl_ssi_driver = { 777 778 .driver = { 778 779 .name = "fsl-ssi-dai", 779 780 .owner = THIS_MODULE, ··· 787 788 { 788 789 printk(KERN_INFO "Freescale Synchronous Serial Interface (SSI) ASoC Driver\n"); 789 790 790 - return of_register_platform_driver(&fsl_ssi_driver); 791 + return platform_driver_register(&fsl_ssi_driver); 791 792 } 792 793 793 794 static void __exit fsl_ssi_exit(void) 794 795 { 795 - of_unregister_platform_driver(&fsl_ssi_driver); 796 + platform_driver_unregister(&fsl_ssi_driver); 796 797 } 797 798 798 799 module_init(fsl_ssi_init);
+11 -13
sound/soc/fsl/mpc5200_dma.c
··· 368 368 .pcm_free = &psc_dma_free, 369 369 }; 370 370 371 - static int mpc5200_hpcd_probe(struct of_device *op, 372 - const struct of_device_id *match) 371 + static int mpc5200_hpcd_probe(struct of_device *op) 373 372 { 374 373 phys_addr_t fifo; 375 374 struct psc_dma *psc_dma; ··· 510 511 } 511 512 512 513 static struct of_device_id mpc5200_hpcd_match[] = { 513 - { 514 - .compatible = "fsl,mpc5200-pcm", 515 - }, 514 + { .compatible = "fsl,mpc5200-pcm", }, 516 515 {} 517 516 }; 518 517 MODULE_DEVICE_TABLE(of, mpc5200_hpcd_match); 519 518 520 - static struct of_platform_driver mpc5200_hpcd_of_driver = { 521 - .owner = THIS_MODULE, 522 - .name = "mpc5200-pcm-audio", 523 - .match_table = mpc5200_hpcd_match, 519 + static struct platform_driver mpc5200_hpcd_of_driver = { 524 520 .probe = mpc5200_hpcd_probe, 525 521 .remove = mpc5200_hpcd_remove, 522 + .dev = { 523 + .owner = THIS_MODULE, 524 + .name = "mpc5200-pcm-audio", 525 + .of_match_table = mpc5200_hpcd_match, 526 + } 526 527 }; 527 528 528 529 static int __init mpc5200_hpcd_init(void) 529 530 { 530 - return of_register_platform_driver(&mpc5200_hpcd_of_driver); 531 + return platform_driver_register(&mpc5200_hpcd_of_driver); 531 532 } 533 + module_init(mpc5200_hpcd_init); 532 534 533 535 static void __exit mpc5200_hpcd_exit(void) 534 536 { 535 - of_unregister_platform_driver(&mpc5200_hpcd_of_driver); 537 + platform_driver_unregister(&mpc5200_hpcd_of_driver); 536 538 } 537 - 538 - module_init(mpc5200_hpcd_init); 539 539 module_exit(mpc5200_hpcd_exit); 540 540 541 541 MODULE_AUTHOR("Grant Likely <grant.likely@secretlab.ca>");
+4 -5
sound/soc/fsl/mpc5200_psc_ac97.c
··· 272 272 * - Probe/remove operations 273 273 * - OF device match table 274 274 */ 275 - static int __devinit psc_ac97_of_probe(struct platform_device *op, 276 - const struct of_device_id *match) 275 + static int __devinit psc_ac97_of_probe(struct platform_device *op) 277 276 { 278 277 int rc; 279 278 struct snd_ac97 ac97; ··· 315 316 }; 316 317 MODULE_DEVICE_TABLE(of, psc_ac97_match); 317 318 318 - static struct of_platform_driver psc_ac97_driver = { 319 + static struct platform_driver psc_ac97_driver = { 319 320 .probe = psc_ac97_of_probe, 320 321 .remove = __devexit_p(psc_ac97_of_remove), 321 322 .driver = { ··· 331 332 */ 332 333 static int __init psc_ac97_init(void) 333 334 { 334 - return of_register_platform_driver(&psc_ac97_driver); 335 + return platform_driver_register(&psc_ac97_driver); 335 336 } 336 337 module_init(psc_ac97_init); 337 338 338 339 static void __exit psc_ac97_exit(void) 339 340 { 340 - of_unregister_platform_driver(&psc_ac97_driver); 341 + platform_driver_unregister(&psc_ac97_driver); 341 342 } 342 343 module_exit(psc_ac97_exit); 343 344
+4 -5
sound/soc/fsl/mpc5200_psc_i2s.c
··· 150 150 * - Probe/remove operations 151 151 * - OF device match table 152 152 */ 153 - static int __devinit psc_i2s_of_probe(struct platform_device *op, 154 - const struct of_device_id *match) 153 + static int __devinit psc_i2s_of_probe(struct platform_device *op) 155 154 { 156 155 int rc; 157 156 struct psc_dma *psc_dma; ··· 212 213 }; 213 214 MODULE_DEVICE_TABLE(of, psc_i2s_match); 214 215 215 - static struct of_platform_driver psc_i2s_driver = { 216 + static struct platform_driver psc_i2s_driver = { 216 217 .probe = psc_i2s_of_probe, 217 218 .remove = __devexit_p(psc_i2s_of_remove), 218 219 .driver = { ··· 228 229 */ 229 230 static int __init psc_i2s_init(void) 230 231 { 231 - return of_register_platform_driver(&psc_i2s_driver); 232 + return platform_driver_register(&psc_i2s_driver); 232 233 } 233 234 module_init(psc_i2s_init); 234 235 235 236 static void __exit psc_i2s_exit(void) 236 237 { 237 - of_unregister_platform_driver(&psc_i2s_driver); 238 + platform_driver_unregister(&psc_i2s_driver); 238 239 } 239 240 module_exit(psc_i2s_exit); 240 241
+4 -4
sound/sparc/amd7930.c
··· 1002 1002 return 0; 1003 1003 } 1004 1004 1005 - static int __devinit amd7930_sbus_probe(struct platform_device *op, const struct of_device_id *match) 1005 + static int __devinit amd7930_sbus_probe(struct platform_device *op) 1006 1006 { 1007 1007 struct resource *rp = &op->resource[0]; 1008 1008 static int dev_num; ··· 1064 1064 {}, 1065 1065 }; 1066 1066 1067 - static struct of_platform_driver amd7930_sbus_driver = { 1067 + static struct platform_driver amd7930_sbus_driver = { 1068 1068 .driver = { 1069 1069 .name = "audio", 1070 1070 .owner = THIS_MODULE, ··· 1075 1075 1076 1076 static int __init amd7930_init(void) 1077 1077 { 1078 - return of_register_platform_driver(&amd7930_sbus_driver); 1078 + return platform_driver_register(&amd7930_sbus_driver); 1079 1079 } 1080 1080 1081 1081 static void __exit amd7930_exit(void) ··· 1092 1092 1093 1093 amd7930_list = NULL; 1094 1094 1095 - of_unregister_platform_driver(&amd7930_sbus_driver); 1095 + platform_driver_unregister(&amd7930_sbus_driver); 1096 1096 } 1097 1097 1098 1098 module_init(amd7930_init);
+8 -8
sound/sparc/cs4231.c
··· 1856 1856 return 0; 1857 1857 } 1858 1858 1859 - static int __devinit cs4231_sbus_probe(struct platform_device *op, const struct of_device_id *match) 1859 + static int __devinit cs4231_sbus_probe(struct platform_device *op) 1860 1860 { 1861 1861 struct resource *rp = &op->resource[0]; 1862 1862 struct snd_card *card; ··· 2048 2048 return 0; 2049 2049 } 2050 2050 2051 - static int __devinit cs4231_ebus_probe(struct platform_device *op, const struct of_device_id *match) 2051 + static int __devinit cs4231_ebus_probe(struct platform_device *op) 2052 2052 { 2053 2053 struct snd_card *card; 2054 2054 int err; ··· 2072 2072 } 2073 2073 #endif 2074 2074 2075 - static int __devinit cs4231_probe(struct platform_device *op, const struct of_device_id *match) 2075 + static int __devinit cs4231_probe(struct platform_device *op) 2076 2076 { 2077 2077 #ifdef EBUS_SUPPORT 2078 2078 if (!strcmp(op->dev.of_node->parent->name, "ebus")) 2079 - return cs4231_ebus_probe(op, match); 2079 + return cs4231_ebus_probe(op); 2080 2080 #endif 2081 2081 #ifdef SBUS_SUPPORT 2082 2082 if (!strcmp(op->dev.of_node->parent->name, "sbus") || 2083 2083 !strcmp(op->dev.of_node->parent->name, "sbi")) 2084 - return cs4231_sbus_probe(op, match); 2084 + return cs4231_sbus_probe(op); 2085 2085 #endif 2086 2086 return -ENODEV; 2087 2087 } ··· 2108 2108 2109 2109 MODULE_DEVICE_TABLE(of, cs4231_match); 2110 2110 2111 - static struct of_platform_driver cs4231_driver = { 2111 + static struct platform_driver cs4231_driver = { 2112 2112 .driver = { 2113 2113 .name = "audio", 2114 2114 .owner = THIS_MODULE, ··· 2120 2120 2121 2121 static int __init cs4231_init(void) 2122 2122 { 2123 - return of_register_platform_driver(&cs4231_driver); 2123 + return platform_driver_register(&cs4231_driver); 2124 2124 } 2125 2125 2126 2126 static void __exit cs4231_exit(void) 2127 2127 { 2128 - of_unregister_platform_driver(&cs4231_driver); 2128 + platform_driver_unregister(&cs4231_driver); 2129 2129 } 2130 2130 2131 2131 module_init(cs4231_init);
+4 -4
sound/sparc/dbri.c
··· 2592 2592 (void *)dbri->dma, dbri->dma_dvma); 2593 2593 } 2594 2594 2595 - static int __devinit dbri_probe(struct platform_device *op, const struct of_device_id *match) 2595 + static int __devinit dbri_probe(struct platform_device *op) 2596 2596 { 2597 2597 struct snd_dbri *dbri; 2598 2598 struct resource *rp; ··· 2686 2686 2687 2687 MODULE_DEVICE_TABLE(of, dbri_match); 2688 2688 2689 - static struct of_platform_driver dbri_sbus_driver = { 2689 + static struct platform_driver dbri_sbus_driver = { 2690 2690 .driver = { 2691 2691 .name = "dbri", 2692 2692 .owner = THIS_MODULE, ··· 2699 2699 /* Probe for the dbri chip and then attach the driver. */ 2700 2700 static int __init dbri_init(void) 2701 2701 { 2702 - return of_register_platform_driver(&dbri_sbus_driver); 2702 + return platform_driver_register(&dbri_sbus_driver); 2703 2703 } 2704 2704 2705 2705 static void __exit dbri_exit(void) 2706 2706 { 2707 - of_unregister_platform_driver(&dbri_sbus_driver); 2707 + platform_driver_unregister(&dbri_sbus_driver); 2708 2708 } 2709 2709 2710 2710 module_init(dbri_init);