Commit 18d306d1375696b0e6b5b39e4744d7fa2ad5e170

Authored by Grant Likely
1 parent e5263a5176

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

Get rid of users of of_platform_driver in drivers/spi.  The
of_platform_{,un}register_driver functions are going away, so the
users need to be converted to using the platform_bus_type directly.

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

Showing 8 changed files with 28 additions and 36 deletions Side-by-side Diff

drivers/spi/mpc512x_psc_spi.c
... ... @@ -507,8 +507,7 @@
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;
... ... @@ -551,7 +550,7 @@
551 550  
552 551 MODULE_DEVICE_TABLE(of, mpc512x_psc_spi_of_match);
553 552  
554   -static struct of_platform_driver mpc512x_psc_spi_of_driver = {
  553 +static struct platform_driver mpc512x_psc_spi_of_driver = {
555 554 .probe = mpc512x_psc_spi_of_probe,
556 555 .remove = __devexit_p(mpc512x_psc_spi_of_remove),
557 556 .driver = {
558 557  
... ... @@ -563,13 +562,13 @@
563 562  
564 563 static int __init mpc512x_psc_spi_init(void)
565 564 {
566   - return of_register_platform_driver(&mpc512x_psc_spi_of_driver);
  565 + return platform_driver_register(&mpc512x_psc_spi_of_driver);
567 566 }
568 567 module_init(mpc512x_psc_spi_init);
569 568  
570 569 static void __exit mpc512x_psc_spi_exit(void)
571 570 {
572   - of_unregister_platform_driver(&mpc512x_psc_spi_of_driver);
  571 + platform_driver_unregister(&mpc512x_psc_spi_of_driver);
573 572 }
574 573 module_exit(mpc512x_psc_spi_exit);
575 574  
drivers/spi/mpc52xx_psc_spi.c
... ... @@ -450,8 +450,7 @@
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;
... ... @@ -503,7 +502,7 @@
503 502  
504 503 MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match);
505 504  
506   -static struct of_platform_driver mpc52xx_psc_spi_of_driver = {
  505 +static struct platform_driver mpc52xx_psc_spi_of_driver = {
507 506 .probe = mpc52xx_psc_spi_of_probe,
508 507 .remove = __devexit_p(mpc52xx_psc_spi_of_remove),
509 508 .driver = {
510 509  
... ... @@ -515,13 +514,13 @@
515 514  
516 515 static int __init mpc52xx_psc_spi_init(void)
517 516 {
518   - return of_register_platform_driver(&mpc52xx_psc_spi_of_driver);
  517 + return platform_driver_register(&mpc52xx_psc_spi_of_driver);
519 518 }
520 519 module_init(mpc52xx_psc_spi_init);
521 520  
522 521 static void __exit mpc52xx_psc_spi_exit(void)
523 522 {
524   - of_unregister_platform_driver(&mpc52xx_psc_spi_of_driver);
  523 + platform_driver_unregister(&mpc52xx_psc_spi_of_driver);
525 524 }
526 525 module_exit(mpc52xx_psc_spi_exit);
527 526  
drivers/spi/mpc52xx_spi.c
... ... @@ -390,8 +390,7 @@
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;
... ... @@ -556,7 +555,7 @@
556 555 };
557 556 MODULE_DEVICE_TABLE(of, mpc52xx_spi_match);
558 557  
559   -static struct of_platform_driver mpc52xx_spi_of_driver = {
  558 +static struct platform_driver mpc52xx_spi_of_driver = {
560 559 .driver = {
561 560 .name = "mpc52xx-spi",
562 561 .owner = THIS_MODULE,
563 562  
... ... @@ -568,13 +567,13 @@
568 567  
569 568 static int __init mpc52xx_spi_init(void)
570 569 {
571   - return of_register_platform_driver(&mpc52xx_spi_of_driver);
  570 + return platform_driver_register(&mpc52xx_spi_of_driver);
572 571 }
573 572 module_init(mpc52xx_spi_init);
574 573  
575 574 static void __exit mpc52xx_spi_exit(void)
576 575 {
577   - of_unregister_platform_driver(&mpc52xx_spi_of_driver);
  576 + platform_driver_unregister(&mpc52xx_spi_of_driver);
578 577 }
579 578 module_exit(mpc52xx_spi_exit);
drivers/spi/spi_fsl_espi.c
... ... @@ -685,8 +685,7 @@
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;
... ... @@ -695,7 +694,7 @@
695 694 struct resource irq;
696 695 int ret = -ENOMEM;
697 696  
698   - ret = of_mpc8xxx_spi_probe(ofdev, ofid);
  697 + ret = of_mpc8xxx_spi_probe(ofdev);
699 698 if (ret)
700 699 return ret;
701 700  
... ... @@ -736,7 +735,7 @@
736 735 };
737 736 MODULE_DEVICE_TABLE(of, of_fsl_espi_match);
738 737  
739   -static struct of_platform_driver fsl_espi_driver = {
  738 +static struct platform_driver fsl_espi_driver = {
740 739 .driver = {
741 740 .name = "fsl_espi",
742 741 .owner = THIS_MODULE,
743 742  
... ... @@ -748,13 +747,13 @@
748 747  
749 748 static int __init fsl_espi_init(void)
750 749 {
751   - return of_register_platform_driver(&fsl_espi_driver);
  750 + return platform_driver_register(&fsl_espi_driver);
752 751 }
753 752 module_init(fsl_espi_init);
754 753  
755 754 static void __exit fsl_espi_exit(void)
756 755 {
757   - of_unregister_platform_driver(&fsl_espi_driver);
  756 + platform_driver_unregister(&fsl_espi_driver);
758 757 }
759 758 module_exit(fsl_espi_exit);
760 759  
drivers/spi/spi_fsl_lib.c
... ... @@ -189,8 +189,7 @@
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;
drivers/spi/spi_fsl_lib.h
... ... @@ -118,8 +118,7 @@
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__ */
drivers/spi/spi_fsl_spi.c
... ... @@ -1042,8 +1042,7 @@
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;
... ... @@ -1052,7 +1051,7 @@
1052 1051 struct resource irq;
1053 1052 int ret = -ENOMEM;
1054 1053  
1055   - ret = of_mpc8xxx_spi_probe(ofdev, ofid);
  1054 + ret = of_mpc8xxx_spi_probe(ofdev);
1056 1055 if (ret)
1057 1056 return ret;
1058 1057  
... ... @@ -1100,7 +1099,7 @@
1100 1099 };
1101 1100 MODULE_DEVICE_TABLE(of, of_fsl_spi_match);
1102 1101  
1103   -static struct of_platform_driver of_fsl_spi_driver = {
  1102 +static struct platform_driver of_fsl_spi_driver = {
1104 1103 .driver = {
1105 1104 .name = "fsl_spi",
1106 1105 .owner = THIS_MODULE,
1107 1106  
... ... @@ -1177,13 +1176,13 @@
1177 1176 static int __init fsl_spi_init(void)
1178 1177 {
1179 1178 legacy_driver_register();
1180   - return of_register_platform_driver(&of_fsl_spi_driver);
  1179 + return platform_driver_register(&of_fsl_spi_driver);
1181 1180 }
1182 1181 module_init(fsl_spi_init);
1183 1182  
1184 1183 static void __exit fsl_spi_exit(void)
1185 1184 {
1186   - of_unregister_platform_driver(&of_fsl_spi_driver);
  1185 + platform_driver_unregister(&of_fsl_spi_driver);
1187 1186 legacy_driver_unregister();
1188 1187 }
1189 1188 module_exit(fsl_spi_exit);
drivers/spi/spi_ppc4xx.c
... ... @@ -390,8 +390,7 @@
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;
... ... @@ -586,7 +585,7 @@
586 585  
587 586 MODULE_DEVICE_TABLE(of, spi_ppc4xx_of_match);
588 587  
589   -static struct of_platform_driver spi_ppc4xx_of_driver = {
  588 +static struct platform_driver spi_ppc4xx_of_driver = {
590 589 .probe = spi_ppc4xx_of_probe,
591 590 .remove = __exit_p(spi_ppc4xx_of_remove),
592 591 .driver = {
593 592  
... ... @@ -598,13 +597,13 @@
598 597  
599 598 static int __init spi_ppc4xx_init(void)
600 599 {
601   - return of_register_platform_driver(&spi_ppc4xx_of_driver);
  600 + return platform_driver_register(&spi_ppc4xx_of_driver);
602 601 }
603 602 module_init(spi_ppc4xx_init);
604 603  
605 604 static void __exit spi_ppc4xx_exit(void)
606 605 {
607   - of_unregister_platform_driver(&spi_ppc4xx_of_driver);
  606 + platform_driver_unregister(&spi_ppc4xx_of_driver);
608 607 }
609 608 module_exit(spi_ppc4xx_exit);
610 609