diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2011-02-22 23:02:43 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-02-28 15:22:44 -0500 |
commit | 18d306d1375696b0e6b5b39e4744d7fa2ad5e170 (patch) | |
tree | 670eac5a75e3b6b0c76903da4d3cf6334d28fe5b /drivers | |
parent | e5263a517688b83861d406223a0f111a6e4116ff (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/mpc512x_psc_spi.c | 9 | ||||
-rw-r--r-- | drivers/spi/mpc52xx_psc_spi.c | 9 | ||||
-rw-r--r-- | drivers/spi/mpc52xx_spi.c | 9 | ||||
-rw-r--r-- | drivers/spi/spi_fsl_espi.c | 11 | ||||
-rw-r--r-- | drivers/spi/spi_fsl_lib.c | 3 | ||||
-rw-r--r-- | drivers/spi/spi_fsl_lib.h | 3 | ||||
-rw-r--r-- | drivers/spi/spi_fsl_spi.c | 11 | ||||
-rw-r--r-- | drivers/spi/spi_ppc4xx.c | 9 |
8 files changed, 28 insertions, 36 deletions
diff --git a/drivers/spi/mpc512x_psc_spi.c b/drivers/spi/mpc512x_psc_spi.c index 77d9e7ee8b27..6a5b4238fb6b 100644 --- a/drivers/spi/mpc512x_psc_spi.c +++ b/drivers/spi/mpc512x_psc_spi.c | |||
@@ -507,8 +507,7 @@ static int __devexit mpc512x_psc_spi_do_remove(struct device *dev) | |||
507 | return 0; | 507 | return 0; |
508 | } | 508 | } |
509 | 509 | ||
510 | static int __devinit mpc512x_psc_spi_of_probe(struct platform_device *op, | 510 | static int __devinit mpc512x_psc_spi_of_probe(struct platform_device *op) |
511 | const struct of_device_id *match) | ||
512 | { | 511 | { |
513 | const u32 *regaddr_p; | 512 | const u32 *regaddr_p; |
514 | u64 regaddr64, size64; | 513 | u64 regaddr64, size64; |
@@ -551,7 +550,7 @@ static struct of_device_id mpc512x_psc_spi_of_match[] = { | |||
551 | 550 | ||
552 | MODULE_DEVICE_TABLE(of, mpc512x_psc_spi_of_match); | 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 | .probe = mpc512x_psc_spi_of_probe, | 554 | .probe = mpc512x_psc_spi_of_probe, |
556 | .remove = __devexit_p(mpc512x_psc_spi_of_remove), | 555 | .remove = __devexit_p(mpc512x_psc_spi_of_remove), |
557 | .driver = { | 556 | .driver = { |
@@ -563,13 +562,13 @@ static struct of_platform_driver mpc512x_psc_spi_of_driver = { | |||
563 | 562 | ||
564 | static int __init mpc512x_psc_spi_init(void) | 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 | module_init(mpc512x_psc_spi_init); | 567 | module_init(mpc512x_psc_spi_init); |
569 | 568 | ||
570 | static void __exit mpc512x_psc_spi_exit(void) | 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 | module_exit(mpc512x_psc_spi_exit); | 573 | module_exit(mpc512x_psc_spi_exit); |
575 | 574 | ||
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c index 8a904c1c8485..e30baf0852ac 100644 --- a/drivers/spi/mpc52xx_psc_spi.c +++ b/drivers/spi/mpc52xx_psc_spi.c | |||
@@ -450,8 +450,7 @@ free_master: | |||
450 | return ret; | 450 | return ret; |
451 | } | 451 | } |
452 | 452 | ||
453 | static int __devinit mpc52xx_psc_spi_of_probe(struct platform_device *op, | 453 | static int __devinit mpc52xx_psc_spi_of_probe(struct platform_device *op) |
454 | const struct of_device_id *match) | ||
455 | { | 454 | { |
456 | const u32 *regaddr_p; | 455 | const u32 *regaddr_p; |
457 | u64 regaddr64, size64; | 456 | u64 regaddr64, size64; |
@@ -503,7 +502,7 @@ static const struct of_device_id mpc52xx_psc_spi_of_match[] = { | |||
503 | 502 | ||
504 | MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match); | 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 | .probe = mpc52xx_psc_spi_of_probe, | 506 | .probe = mpc52xx_psc_spi_of_probe, |
508 | .remove = __devexit_p(mpc52xx_psc_spi_of_remove), | 507 | .remove = __devexit_p(mpc52xx_psc_spi_of_remove), |
509 | .driver = { | 508 | .driver = { |
@@ -515,13 +514,13 @@ static struct of_platform_driver mpc52xx_psc_spi_of_driver = { | |||
515 | 514 | ||
516 | static int __init mpc52xx_psc_spi_init(void) | 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 | module_init(mpc52xx_psc_spi_init); | 519 | module_init(mpc52xx_psc_spi_init); |
521 | 520 | ||
522 | static void __exit mpc52xx_psc_spi_exit(void) | 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 | module_exit(mpc52xx_psc_spi_exit); | 525 | module_exit(mpc52xx_psc_spi_exit); |
527 | 526 | ||
diff --git a/drivers/spi/mpc52xx_spi.c b/drivers/spi/mpc52xx_spi.c index 84439f655601..015a974bed72 100644 --- a/drivers/spi/mpc52xx_spi.c +++ b/drivers/spi/mpc52xx_spi.c | |||
@@ -390,8 +390,7 @@ static int mpc52xx_spi_transfer(struct spi_device *spi, struct spi_message *m) | |||
390 | /* | 390 | /* |
391 | * OF Platform Bus Binding | 391 | * OF Platform Bus Binding |
392 | */ | 392 | */ |
393 | static int __devinit mpc52xx_spi_probe(struct platform_device *op, | 393 | static int __devinit mpc52xx_spi_probe(struct platform_device *op) |
394 | const struct of_device_id *match) | ||
395 | { | 394 | { |
396 | struct spi_master *master; | 395 | struct spi_master *master; |
397 | struct mpc52xx_spi *ms; | 396 | struct mpc52xx_spi *ms; |
@@ -556,7 +555,7 @@ static const struct of_device_id mpc52xx_spi_match[] __devinitconst = { | |||
556 | }; | 555 | }; |
557 | MODULE_DEVICE_TABLE(of, mpc52xx_spi_match); | 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 | .driver = { | 559 | .driver = { |
561 | .name = "mpc52xx-spi", | 560 | .name = "mpc52xx-spi", |
562 | .owner = THIS_MODULE, | 561 | .owner = THIS_MODULE, |
@@ -568,13 +567,13 @@ static struct of_platform_driver mpc52xx_spi_of_driver = { | |||
568 | 567 | ||
569 | static int __init mpc52xx_spi_init(void) | 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 | module_init(mpc52xx_spi_init); | 572 | module_init(mpc52xx_spi_init); |
574 | 573 | ||
575 | static void __exit mpc52xx_spi_exit(void) | 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 | module_exit(mpc52xx_spi_exit); | 578 | module_exit(mpc52xx_spi_exit); |
580 | 579 | ||
diff --git a/drivers/spi/spi_fsl_espi.c b/drivers/spi/spi_fsl_espi.c index a99e2333b949..900e921ab80e 100644 --- a/drivers/spi/spi_fsl_espi.c +++ b/drivers/spi/spi_fsl_espi.c | |||
@@ -685,8 +685,7 @@ static int of_fsl_espi_get_chipselects(struct device *dev) | |||
685 | return 0; | 685 | return 0; |
686 | } | 686 | } |
687 | 687 | ||
688 | static int __devinit of_fsl_espi_probe(struct platform_device *ofdev, | 688 | static int __devinit of_fsl_espi_probe(struct platform_device *ofdev) |
689 | const struct of_device_id *ofid) | ||
690 | { | 689 | { |
691 | struct device *dev = &ofdev->dev; | 690 | struct device *dev = &ofdev->dev; |
692 | struct device_node *np = ofdev->dev.of_node; | 691 | struct device_node *np = ofdev->dev.of_node; |
@@ -695,7 +694,7 @@ static int __devinit of_fsl_espi_probe(struct platform_device *ofdev, | |||
695 | struct resource irq; | 694 | struct resource irq; |
696 | int ret = -ENOMEM; | 695 | int ret = -ENOMEM; |
697 | 696 | ||
698 | ret = of_mpc8xxx_spi_probe(ofdev, ofid); | 697 | ret = of_mpc8xxx_spi_probe(ofdev); |
699 | if (ret) | 698 | if (ret) |
700 | return ret; | 699 | return ret; |
701 | 700 | ||
@@ -736,7 +735,7 @@ static const struct of_device_id of_fsl_espi_match[] = { | |||
736 | }; | 735 | }; |
737 | MODULE_DEVICE_TABLE(of, of_fsl_espi_match); | 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 | .driver = { | 739 | .driver = { |
741 | .name = "fsl_espi", | 740 | .name = "fsl_espi", |
742 | .owner = THIS_MODULE, | 741 | .owner = THIS_MODULE, |
@@ -748,13 +747,13 @@ static struct of_platform_driver fsl_espi_driver = { | |||
748 | 747 | ||
749 | static int __init fsl_espi_init(void) | 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 | module_init(fsl_espi_init); | 752 | module_init(fsl_espi_init); |
754 | 753 | ||
755 | static void __exit fsl_espi_exit(void) | 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 | module_exit(fsl_espi_exit); | 758 | module_exit(fsl_espi_exit); |
760 | 759 | ||
diff --git a/drivers/spi/spi_fsl_lib.c b/drivers/spi/spi_fsl_lib.c index 5cd741fdb5c3..ff59f42ae990 100644 --- a/drivers/spi/spi_fsl_lib.c +++ b/drivers/spi/spi_fsl_lib.c | |||
@@ -189,8 +189,7 @@ int __devexit mpc8xxx_spi_remove(struct device *dev) | |||
189 | return 0; | 189 | return 0; |
190 | } | 190 | } |
191 | 191 | ||
192 | int __devinit of_mpc8xxx_spi_probe(struct platform_device *ofdev, | 192 | int __devinit of_mpc8xxx_spi_probe(struct platform_device *ofdev) |
193 | const struct of_device_id *ofid) | ||
194 | { | 193 | { |
195 | struct device *dev = &ofdev->dev; | 194 | struct device *dev = &ofdev->dev; |
196 | struct device_node *np = ofdev->dev.of_node; | 195 | struct device_node *np = ofdev->dev.of_node; |
diff --git a/drivers/spi/spi_fsl_lib.h b/drivers/spi/spi_fsl_lib.h index 281e060977cd..cbe881b9ea76 100644 --- a/drivers/spi/spi_fsl_lib.h +++ b/drivers/spi/spi_fsl_lib.h | |||
@@ -118,7 +118,6 @@ extern const char *mpc8xxx_spi_strmode(unsigned int flags); | |||
118 | extern int mpc8xxx_spi_probe(struct device *dev, struct resource *mem, | 118 | extern int mpc8xxx_spi_probe(struct device *dev, struct resource *mem, |
119 | unsigned int irq); | 119 | unsigned int irq); |
120 | extern int mpc8xxx_spi_remove(struct device *dev); | 120 | extern int mpc8xxx_spi_remove(struct device *dev); |
121 | extern int of_mpc8xxx_spi_probe(struct platform_device *ofdev, | 121 | extern int of_mpc8xxx_spi_probe(struct platform_device *ofdev); |
122 | const struct of_device_id *ofid); | ||
123 | 122 | ||
124 | #endif /* __SPI_FSL_LIB_H__ */ | 123 | #endif /* __SPI_FSL_LIB_H__ */ |
diff --git a/drivers/spi/spi_fsl_spi.c b/drivers/spi/spi_fsl_spi.c index 7ca52d3ae8f8..7963c9b49566 100644 --- a/drivers/spi/spi_fsl_spi.c +++ b/drivers/spi/spi_fsl_spi.c | |||
@@ -1042,8 +1042,7 @@ static int of_fsl_spi_free_chipselects(struct device *dev) | |||
1042 | return 0; | 1042 | return 0; |
1043 | } | 1043 | } |
1044 | 1044 | ||
1045 | static int __devinit of_fsl_spi_probe(struct platform_device *ofdev, | 1045 | static int __devinit of_fsl_spi_probe(struct platform_device *ofdev) |
1046 | const struct of_device_id *ofid) | ||
1047 | { | 1046 | { |
1048 | struct device *dev = &ofdev->dev; | 1047 | struct device *dev = &ofdev->dev; |
1049 | struct device_node *np = ofdev->dev.of_node; | 1048 | struct device_node *np = ofdev->dev.of_node; |
@@ -1052,7 +1051,7 @@ static int __devinit of_fsl_spi_probe(struct platform_device *ofdev, | |||
1052 | struct resource irq; | 1051 | struct resource irq; |
1053 | int ret = -ENOMEM; | 1052 | int ret = -ENOMEM; |
1054 | 1053 | ||
1055 | ret = of_mpc8xxx_spi_probe(ofdev, ofid); | 1054 | ret = of_mpc8xxx_spi_probe(ofdev); |
1056 | if (ret) | 1055 | if (ret) |
1057 | return ret; | 1056 | return ret; |
1058 | 1057 | ||
@@ -1100,7 +1099,7 @@ static const struct of_device_id of_fsl_spi_match[] = { | |||
1100 | }; | 1099 | }; |
1101 | MODULE_DEVICE_TABLE(of, of_fsl_spi_match); | 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 | .driver = { | 1103 | .driver = { |
1105 | .name = "fsl_spi", | 1104 | .name = "fsl_spi", |
1106 | .owner = THIS_MODULE, | 1105 | .owner = THIS_MODULE, |
@@ -1177,13 +1176,13 @@ static void __exit legacy_driver_unregister(void) {} | |||
1177 | static int __init fsl_spi_init(void) | 1176 | static int __init fsl_spi_init(void) |
1178 | { | 1177 | { |
1179 | legacy_driver_register(); | 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 | module_init(fsl_spi_init); | 1181 | module_init(fsl_spi_init); |
1183 | 1182 | ||
1184 | static void __exit fsl_spi_exit(void) | 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 | legacy_driver_unregister(); | 1186 | legacy_driver_unregister(); |
1188 | } | 1187 | } |
1189 | module_exit(fsl_spi_exit); | 1188 | module_exit(fsl_spi_exit); |
diff --git a/drivers/spi/spi_ppc4xx.c b/drivers/spi/spi_ppc4xx.c index 80e172d3e72a..2a298c029194 100644 --- a/drivers/spi/spi_ppc4xx.c +++ b/drivers/spi/spi_ppc4xx.c | |||
@@ -390,8 +390,7 @@ static void free_gpios(struct ppc4xx_spi *hw) | |||
390 | /* | 390 | /* |
391 | * platform_device layer stuff... | 391 | * platform_device layer stuff... |
392 | */ | 392 | */ |
393 | static int __init spi_ppc4xx_of_probe(struct platform_device *op, | 393 | static int __init spi_ppc4xx_of_probe(struct platform_device *op) |
394 | const struct of_device_id *match) | ||
395 | { | 394 | { |
396 | struct ppc4xx_spi *hw; | 395 | struct ppc4xx_spi *hw; |
397 | struct spi_master *master; | 396 | struct spi_master *master; |
@@ -586,7 +585,7 @@ static const struct of_device_id spi_ppc4xx_of_match[] = { | |||
586 | 585 | ||
587 | MODULE_DEVICE_TABLE(of, spi_ppc4xx_of_match); | 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 | .probe = spi_ppc4xx_of_probe, | 589 | .probe = spi_ppc4xx_of_probe, |
591 | .remove = __exit_p(spi_ppc4xx_of_remove), | 590 | .remove = __exit_p(spi_ppc4xx_of_remove), |
592 | .driver = { | 591 | .driver = { |
@@ -598,13 +597,13 @@ static struct of_platform_driver spi_ppc4xx_of_driver = { | |||
598 | 597 | ||
599 | static int __init spi_ppc4xx_init(void) | 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 | module_init(spi_ppc4xx_init); | 602 | module_init(spi_ppc4xx_init); |
604 | 603 | ||
605 | static void __exit spi_ppc4xx_exit(void) | 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 | module_exit(spi_ppc4xx_exit); | 608 | module_exit(spi_ppc4xx_exit); |
610 | 609 | ||