aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-01-26 05:40:23 -0500
committerFelipe Balbi <balbi@ti.com>2012-01-31 07:18:26 -0500
commite9e8c85e69310141d78daaecd6a56138700ac317 (patch)
treeb778093675b5e115fc3289385ea323225fe66887 /drivers/usb/musb
parentf557978745bbea2e7305588d33aac60f4dd42447 (diff)
usb: musb: make modules behave better
There's really no point in doing all that initcall trickery when we can safely let udev handle module probing for us. Remove all of that trickery, by moving everybody to module_init() and making proper use of platform_device_register() rather than platform_device_probe(). Tested-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com> Tested-by: Tasslehoff Kjappfot <tasskjapp@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/am35x.c11
-rw-r--r--drivers/usb/musb/blackfin.c9
-rw-r--r--drivers/usb/musb/da8xx.c11
-rw-r--r--drivers/usb/musb/davinci.c11
-rw-r--r--drivers/usb/musb/musb_core.c49
-rw-r--r--drivers/usb/musb/musb_debugfs.c2
-rw-r--r--drivers/usb/musb/musb_gadget.c6
-rw-r--r--drivers/usb/musb/omap2430.c11
-rw-r--r--drivers/usb/musb/tusb6010.c11
-rw-r--r--drivers/usb/musb/ux500.c11
10 files changed, 68 insertions, 64 deletions
diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index e233d2b7d335..5285bda1dc4e 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -456,7 +456,7 @@ static const struct musb_platform_ops am35x_ops = {
456 456
457static u64 am35x_dmamask = DMA_BIT_MASK(32); 457static u64 am35x_dmamask = DMA_BIT_MASK(32);
458 458
459static int __init am35x_probe(struct platform_device *pdev) 459static int __devinit am35x_probe(struct platform_device *pdev)
460{ 460{
461 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 461 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
462 struct platform_device *musb; 462 struct platform_device *musb;
@@ -561,7 +561,7 @@ err0:
561 return ret; 561 return ret;
562} 562}
563 563
564static int __exit am35x_remove(struct platform_device *pdev) 564static int __devexit am35x_remove(struct platform_device *pdev)
565{ 565{
566 struct am35x_glue *glue = platform_get_drvdata(pdev); 566 struct am35x_glue *glue = platform_get_drvdata(pdev);
567 567
@@ -630,7 +630,8 @@ static struct dev_pm_ops am35x_pm_ops = {
630#endif 630#endif
631 631
632static struct platform_driver am35x_driver = { 632static struct platform_driver am35x_driver = {
633 .remove = __exit_p(am35x_remove), 633 .probe = am35x_probe,
634 .remove = __devexit_p(am35x_remove),
634 .driver = { 635 .driver = {
635 .name = "musb-am35x", 636 .name = "musb-am35x",
636 .pm = DEV_PM_OPS, 637 .pm = DEV_PM_OPS,
@@ -643,9 +644,9 @@ MODULE_LICENSE("GPL v2");
643 644
644static int __init am35x_init(void) 645static int __init am35x_init(void)
645{ 646{
646 return platform_driver_probe(&am35x_driver, am35x_probe); 647 return platform_driver_register(&am35x_driver);
647} 648}
648subsys_initcall(am35x_init); 649module_init(am35x_init);
649 650
650static void __exit am35x_exit(void) 651static void __exit am35x_exit(void)
651{ 652{
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index 5e7cfba5b079..261af3487b5e 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -463,7 +463,7 @@ static const struct musb_platform_ops bfin_ops = {
463 463
464static u64 bfin_dmamask = DMA_BIT_MASK(32); 464static u64 bfin_dmamask = DMA_BIT_MASK(32);
465 465
466static int __init bfin_probe(struct platform_device *pdev) 466static int __devinit bfin_probe(struct platform_device *pdev)
467{ 467{
468 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 468 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
469 struct platform_device *musb; 469 struct platform_device *musb;
@@ -525,7 +525,7 @@ err0:
525 return ret; 525 return ret;
526} 526}
527 527
528static int __exit bfin_remove(struct platform_device *pdev) 528static int __devexit bfin_remove(struct platform_device *pdev)
529{ 529{
530 struct bfin_glue *glue = platform_get_drvdata(pdev); 530 struct bfin_glue *glue = platform_get_drvdata(pdev);
531 531
@@ -575,6 +575,7 @@ static struct dev_pm_ops bfin_pm_ops = {
575#endif 575#endif
576 576
577static struct platform_driver bfin_driver = { 577static struct platform_driver bfin_driver = {
578 .probe = bfin_probe,
578 .remove = __exit_p(bfin_remove), 579 .remove = __exit_p(bfin_remove),
579 .driver = { 580 .driver = {
580 .name = "musb-blackfin", 581 .name = "musb-blackfin",
@@ -588,9 +589,9 @@ MODULE_LICENSE("GPL v2");
588 589
589static int __init bfin_init(void) 590static int __init bfin_init(void)
590{ 591{
591 return platform_driver_probe(&bfin_driver, bfin_probe); 592 return platform_driver_register(&bfin_driver);
592} 593}
593subsys_initcall(bfin_init); 594module_init(bfin_init);
594 595
595static void __exit bfin_exit(void) 596static void __exit bfin_exit(void)
596{ 597{
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 2613bfdb09b6..01c8f2ece084 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -478,7 +478,7 @@ static const struct musb_platform_ops da8xx_ops = {
478 478
479static u64 da8xx_dmamask = DMA_BIT_MASK(32); 479static u64 da8xx_dmamask = DMA_BIT_MASK(32);
480 480
481static int __init da8xx_probe(struct platform_device *pdev) 481static int __devinit da8xx_probe(struct platform_device *pdev)
482{ 482{
483 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 483 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
484 struct platform_device *musb; 484 struct platform_device *musb;
@@ -562,7 +562,7 @@ err0:
562 return ret; 562 return ret;
563} 563}
564 564
565static int __exit da8xx_remove(struct platform_device *pdev) 565static int __devexit da8xx_remove(struct platform_device *pdev)
566{ 566{
567 struct da8xx_glue *glue = platform_get_drvdata(pdev); 567 struct da8xx_glue *glue = platform_get_drvdata(pdev);
568 568
@@ -576,7 +576,8 @@ static int __exit da8xx_remove(struct platform_device *pdev)
576} 576}
577 577
578static struct platform_driver da8xx_driver = { 578static struct platform_driver da8xx_driver = {
579 .remove = __exit_p(da8xx_remove), 579 .probe = da8xx_probe,
580 .remove = __devexit_p(da8xx_remove),
580 .driver = { 581 .driver = {
581 .name = "musb-da8xx", 582 .name = "musb-da8xx",
582 }, 583 },
@@ -588,9 +589,9 @@ MODULE_LICENSE("GPL v2");
588 589
589static int __init da8xx_init(void) 590static int __init da8xx_init(void)
590{ 591{
591 return platform_driver_probe(&da8xx_driver, da8xx_probe); 592 return platform_driver_register(&da8xx_driver);
592} 593}
593subsys_initcall(da8xx_init); 594module_init(da8xx_init);
594 595
595static void __exit da8xx_exit(void) 596static void __exit da8xx_exit(void)
596{ 597{
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index f9a3f62a83b5..7802c7ec43f9 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -514,7 +514,7 @@ static const struct musb_platform_ops davinci_ops = {
514 514
515static u64 davinci_dmamask = DMA_BIT_MASK(32); 515static u64 davinci_dmamask = DMA_BIT_MASK(32);
516 516
517static int __init davinci_probe(struct platform_device *pdev) 517static int __devinit davinci_probe(struct platform_device *pdev)
518{ 518{
519 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 519 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
520 struct platform_device *musb; 520 struct platform_device *musb;
@@ -597,7 +597,7 @@ err0:
597 return ret; 597 return ret;
598} 598}
599 599
600static int __exit davinci_remove(struct platform_device *pdev) 600static int __devexit davinci_remove(struct platform_device *pdev)
601{ 601{
602 struct davinci_glue *glue = platform_get_drvdata(pdev); 602 struct davinci_glue *glue = platform_get_drvdata(pdev);
603 603
@@ -611,7 +611,8 @@ static int __exit davinci_remove(struct platform_device *pdev)
611} 611}
612 612
613static struct platform_driver davinci_driver = { 613static struct platform_driver davinci_driver = {
614 .remove = __exit_p(davinci_remove), 614 .probe = davinci_probe,
615 .remove = __devexit_p(davinci_remove),
615 .driver = { 616 .driver = {
616 .name = "musb-davinci", 617 .name = "musb-davinci",
617 }, 618 },
@@ -623,9 +624,9 @@ MODULE_LICENSE("GPL v2");
623 624
624static int __init davinci_init(void) 625static int __init davinci_init(void)
625{ 626{
626 return platform_driver_probe(&davinci_driver, davinci_probe); 627 return platform_driver_register(&davinci_driver);
627} 628}
628subsys_initcall(davinci_init); 629module_init(davinci_init);
629 630
630static void __exit davinci_exit(void) 631static void __exit davinci_exit(void)
631{ 632{
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 6a929859b55a..d6134b39e8fc 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1014,12 +1014,12 @@ static void musb_shutdown(struct platform_device *pdev)
1014 || defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE) \ 1014 || defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE) \
1015 || defined(CONFIG_USB_MUSB_AM35X) \ 1015 || defined(CONFIG_USB_MUSB_AM35X) \
1016 || defined(CONFIG_USB_MUSB_AM35X_MODULE) 1016 || defined(CONFIG_USB_MUSB_AM35X_MODULE)
1017static ushort __initdata fifo_mode = 4; 1017static ushort __devinitdata fifo_mode = 4;
1018#elif defined(CONFIG_USB_MUSB_UX500) \ 1018#elif defined(CONFIG_USB_MUSB_UX500) \
1019 || defined(CONFIG_USB_MUSB_UX500_MODULE) 1019 || defined(CONFIG_USB_MUSB_UX500_MODULE)
1020static ushort __initdata fifo_mode = 5; 1020static ushort __devinitdata fifo_mode = 5;
1021#else 1021#else
1022static ushort __initdata fifo_mode = 2; 1022static ushort __devinitdata fifo_mode = 2;
1023#endif 1023#endif
1024 1024
1025/* "modprobe ... fifo_mode=1" etc */ 1025/* "modprobe ... fifo_mode=1" etc */
@@ -1032,7 +1032,7 @@ MODULE_PARM_DESC(fifo_mode, "initial endpoint configuration");
1032 */ 1032 */
1033 1033
1034/* mode 0 - fits in 2KB */ 1034/* mode 0 - fits in 2KB */
1035static struct musb_fifo_cfg __initdata mode_0_cfg[] = { 1035static struct musb_fifo_cfg __devinitdata mode_0_cfg[] = {
1036{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, 1036{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
1037{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, 1037{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
1038{ .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, }, 1038{ .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, },
@@ -1041,7 +1041,7 @@ static struct musb_fifo_cfg __initdata mode_0_cfg[] = {
1041}; 1041};
1042 1042
1043/* mode 1 - fits in 4KB */ 1043/* mode 1 - fits in 4KB */
1044static struct musb_fifo_cfg __initdata mode_1_cfg[] = { 1044static struct musb_fifo_cfg __devinitdata mode_1_cfg[] = {
1045{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, }, 1045{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, },
1046{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, }, 1046{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, },
1047{ .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, .mode = BUF_DOUBLE, }, 1047{ .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, .mode = BUF_DOUBLE, },
@@ -1050,7 +1050,7 @@ static struct musb_fifo_cfg __initdata mode_1_cfg[] = {
1050}; 1050};
1051 1051
1052/* mode 2 - fits in 4KB */ 1052/* mode 2 - fits in 4KB */
1053static struct musb_fifo_cfg __initdata mode_2_cfg[] = { 1053static struct musb_fifo_cfg __devinitdata mode_2_cfg[] = {
1054{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, 1054{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
1055{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, 1055{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
1056{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, 1056{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
@@ -1060,7 +1060,7 @@ static struct musb_fifo_cfg __initdata mode_2_cfg[] = {
1060}; 1060};
1061 1061
1062/* mode 3 - fits in 4KB */ 1062/* mode 3 - fits in 4KB */
1063static struct musb_fifo_cfg __initdata mode_3_cfg[] = { 1063static struct musb_fifo_cfg __devinitdata mode_3_cfg[] = {
1064{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, }, 1064{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, },
1065{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, }, 1065{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, },
1066{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, 1066{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
@@ -1070,7 +1070,7 @@ static struct musb_fifo_cfg __initdata mode_3_cfg[] = {
1070}; 1070};
1071 1071
1072/* mode 4 - fits in 16KB */ 1072/* mode 4 - fits in 16KB */
1073static struct musb_fifo_cfg __initdata mode_4_cfg[] = { 1073static struct musb_fifo_cfg __devinitdata mode_4_cfg[] = {
1074{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, 1074{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
1075{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, 1075{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
1076{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, 1076{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
@@ -1101,7 +1101,7 @@ static struct musb_fifo_cfg __initdata mode_4_cfg[] = {
1101}; 1101};
1102 1102
1103/* mode 5 - fits in 8KB */ 1103/* mode 5 - fits in 8KB */
1104static struct musb_fifo_cfg __initdata mode_5_cfg[] = { 1104static struct musb_fifo_cfg __devinitdata mode_5_cfg[] = {
1105{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, 1105{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
1106{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, 1106{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
1107{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, 1107{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
@@ -1137,7 +1137,7 @@ static struct musb_fifo_cfg __initdata mode_5_cfg[] = {
1137 * 1137 *
1138 * returns negative errno or offset for next fifo. 1138 * returns negative errno or offset for next fifo.
1139 */ 1139 */
1140static int __init 1140static int __devinit
1141fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep, 1141fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep,
1142 const struct musb_fifo_cfg *cfg, u16 offset) 1142 const struct musb_fifo_cfg *cfg, u16 offset)
1143{ 1143{
@@ -1208,11 +1208,11 @@ fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep,
1208 return offset + (maxpacket << ((c_size & MUSB_FIFOSZ_DPB) ? 1 : 0)); 1208 return offset + (maxpacket << ((c_size & MUSB_FIFOSZ_DPB) ? 1 : 0));
1209} 1209}
1210 1210
1211static struct musb_fifo_cfg __initdata ep0_cfg = { 1211static struct musb_fifo_cfg __devinitdata ep0_cfg = {
1212 .style = FIFO_RXTX, .maxpacket = 64, 1212 .style = FIFO_RXTX, .maxpacket = 64,
1213}; 1213};
1214 1214
1215static int __init ep_config_from_table(struct musb *musb) 1215static int __devinit ep_config_from_table(struct musb *musb)
1216{ 1216{
1217 const struct musb_fifo_cfg *cfg; 1217 const struct musb_fifo_cfg *cfg;
1218 unsigned i, n; 1218 unsigned i, n;
@@ -1303,7 +1303,7 @@ done:
1303 * ep_config_from_hw - when MUSB_C_DYNFIFO_DEF is false 1303 * ep_config_from_hw - when MUSB_C_DYNFIFO_DEF is false
1304 * @param musb the controller 1304 * @param musb the controller
1305 */ 1305 */
1306static int __init ep_config_from_hw(struct musb *musb) 1306static int __devinit ep_config_from_hw(struct musb *musb)
1307{ 1307{
1308 u8 epnum = 0; 1308 u8 epnum = 0;
1309 struct musb_hw_ep *hw_ep; 1309 struct musb_hw_ep *hw_ep;
@@ -1350,7 +1350,7 @@ enum { MUSB_CONTROLLER_MHDRC, MUSB_CONTROLLER_HDRC, };
1350/* Initialize MUSB (M)HDRC part of the USB hardware subsystem; 1350/* Initialize MUSB (M)HDRC part of the USB hardware subsystem;
1351 * configure endpoints, or take their config from silicon 1351 * configure endpoints, or take their config from silicon
1352 */ 1352 */
1353static int __init musb_core_init(u16 musb_type, struct musb *musb) 1353static int __devinit musb_core_init(u16 musb_type, struct musb *musb)
1354{ 1354{
1355 u8 reg; 1355 u8 reg;
1356 char *type; 1356 char *type;
@@ -1586,7 +1586,7 @@ irqreturn_t musb_interrupt(struct musb *musb)
1586EXPORT_SYMBOL_GPL(musb_interrupt); 1586EXPORT_SYMBOL_GPL(musb_interrupt);
1587 1587
1588#ifndef CONFIG_MUSB_PIO_ONLY 1588#ifndef CONFIG_MUSB_PIO_ONLY
1589static bool __initdata use_dma = 1; 1589static bool __devinitdata use_dma = 1;
1590 1590
1591/* "modprobe ... use_dma=0" etc */ 1591/* "modprobe ... use_dma=0" etc */
1592module_param(use_dma, bool, 0); 1592module_param(use_dma, bool, 0);
@@ -1774,7 +1774,7 @@ static void musb_irq_work(struct work_struct *data)
1774 * Init support 1774 * Init support
1775 */ 1775 */
1776 1776
1777static struct musb *__init 1777static struct musb *__devinit
1778allocate_instance(struct device *dev, 1778allocate_instance(struct device *dev,
1779 struct musb_hdrc_config *config, void __iomem *mbase) 1779 struct musb_hdrc_config *config, void __iomem *mbase)
1780{ 1780{
@@ -1852,7 +1852,7 @@ static void musb_free(struct musb *musb)
1852 * @mregs: virtual address of controller registers, 1852 * @mregs: virtual address of controller registers,
1853 * not yet corrected for platform-specific offsets 1853 * not yet corrected for platform-specific offsets
1854 */ 1854 */
1855static int __init 1855static int __devinit
1856musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) 1856musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
1857{ 1857{
1858 int status; 1858 int status;
@@ -2072,7 +2072,7 @@ fail0:
2072static u64 *orig_dma_mask; 2072static u64 *orig_dma_mask;
2073#endif 2073#endif
2074 2074
2075static int __init musb_probe(struct platform_device *pdev) 2075static int __devinit musb_probe(struct platform_device *pdev)
2076{ 2076{
2077 struct device *dev = &pdev->dev; 2077 struct device *dev = &pdev->dev;
2078 int irq = platform_get_irq_byname(pdev, "mc"); 2078 int irq = platform_get_irq_byname(pdev, "mc");
@@ -2101,7 +2101,7 @@ static int __init musb_probe(struct platform_device *pdev)
2101 return status; 2101 return status;
2102} 2102}
2103 2103
2104static int __exit musb_remove(struct platform_device *pdev) 2104static int __devexit musb_remove(struct platform_device *pdev)
2105{ 2105{
2106 struct musb *musb = dev_to_musb(&pdev->dev); 2106 struct musb *musb = dev_to_musb(&pdev->dev);
2107 void __iomem *ctrl_base = musb->ctrl_base; 2107 void __iomem *ctrl_base = musb->ctrl_base;
@@ -2361,7 +2361,8 @@ static struct platform_driver musb_driver = {
2361 .owner = THIS_MODULE, 2361 .owner = THIS_MODULE,
2362 .pm = MUSB_DEV_PM_OPS, 2362 .pm = MUSB_DEV_PM_OPS,
2363 }, 2363 },
2364 .remove = __exit_p(musb_remove), 2364 .probe = musb_probe,
2365 .remove = __devexit_p(musb_remove),
2365 .shutdown = musb_shutdown, 2366 .shutdown = musb_shutdown,
2366}; 2367};
2367 2368
@@ -2377,13 +2378,9 @@ static int __init musb_init(void)
2377 ", " 2378 ", "
2378 "otg (peripheral+host)", 2379 "otg (peripheral+host)",
2379 musb_driver_name); 2380 musb_driver_name);
2380 return platform_driver_probe(&musb_driver, musb_probe); 2381 return platform_driver_register(&musb_driver);
2381} 2382}
2382 2383module_init(musb_init);
2383/* make us init after usbcore and i2c (transceivers, regulators, etc)
2384 * and before usb gadget and host-side drivers start to register
2385 */
2386fs_initcall(musb_init);
2387 2384
2388static void __exit musb_cleanup(void) 2385static void __exit musb_cleanup(void)
2389{ 2386{
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c
index 13d9af9bf920..219d0fba584e 100644
--- a/drivers/usb/musb/musb_debugfs.c
+++ b/drivers/usb/musb/musb_debugfs.c
@@ -235,7 +235,7 @@ static const struct file_operations musb_test_mode_fops = {
235 .release = single_release, 235 .release = single_release,
236}; 236};
237 237
238int __init musb_init_debugfs(struct musb *musb) 238int __devinit musb_init_debugfs(struct musb *musb)
239{ 239{
240 struct dentry *root; 240 struct dentry *root;
241 struct dentry *file; 241 struct dentry *file;
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index ac3d2eec20fe..59ab98f08e9e 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1762,7 +1762,7 @@ static void musb_gadget_release(struct device *dev)
1762} 1762}
1763 1763
1764 1764
1765static void __init 1765static void __devinit
1766init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) 1766init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in)
1767{ 1767{
1768 struct musb_hw_ep *hw_ep = musb->endpoints + epnum; 1768 struct musb_hw_ep *hw_ep = musb->endpoints + epnum;
@@ -1799,7 +1799,7 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in)
1799 * Initialize the endpoints exposed to peripheral drivers, with backlinks 1799 * Initialize the endpoints exposed to peripheral drivers, with backlinks
1800 * to the rest of the driver state. 1800 * to the rest of the driver state.
1801 */ 1801 */
1802static inline void __init musb_g_init_endpoints(struct musb *musb) 1802static inline void __devinit musb_g_init_endpoints(struct musb *musb)
1803{ 1803{
1804 u8 epnum; 1804 u8 epnum;
1805 struct musb_hw_ep *hw_ep; 1805 struct musb_hw_ep *hw_ep;
@@ -1832,7 +1832,7 @@ static inline void __init musb_g_init_endpoints(struct musb *musb)
1832/* called once during driver setup to initialize and link into 1832/* called once during driver setup to initialize and link into
1833 * the driver model; memory is zeroed. 1833 * the driver model; memory is zeroed.
1834 */ 1834 */
1835int __init musb_gadget_setup(struct musb *musb) 1835int __devinit musb_gadget_setup(struct musb *musb)
1836{ 1836{
1837 int status; 1837 int status;
1838 1838
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index c27bbbf32b52..b254173e7e85 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -408,7 +408,7 @@ static const struct musb_platform_ops omap2430_ops = {
408 408
409static u64 omap2430_dmamask = DMA_BIT_MASK(32); 409static u64 omap2430_dmamask = DMA_BIT_MASK(32);
410 410
411static int __init omap2430_probe(struct platform_device *pdev) 411static int __devinit omap2430_probe(struct platform_device *pdev)
412{ 412{
413 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 413 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
414 struct platform_device *musb; 414 struct platform_device *musb;
@@ -471,7 +471,7 @@ err0:
471 return ret; 471 return ret;
472} 472}
473 473
474static int __exit omap2430_remove(struct platform_device *pdev) 474static int __devexit omap2430_remove(struct platform_device *pdev)
475{ 475{
476 struct omap2430_glue *glue = platform_get_drvdata(pdev); 476 struct omap2430_glue *glue = platform_get_drvdata(pdev);
477 477
@@ -524,7 +524,8 @@ static struct dev_pm_ops omap2430_pm_ops = {
524#endif 524#endif
525 525
526static struct platform_driver omap2430_driver = { 526static struct platform_driver omap2430_driver = {
527 .remove = __exit_p(omap2430_remove), 527 .probe = omap2430_probe,
528 .remove = __devexit_p(omap2430_remove),
528 .driver = { 529 .driver = {
529 .name = "musb-omap2430", 530 .name = "musb-omap2430",
530 .pm = DEV_PM_OPS, 531 .pm = DEV_PM_OPS,
@@ -537,9 +538,9 @@ MODULE_LICENSE("GPL v2");
537 538
538static int __init omap2430_init(void) 539static int __init omap2430_init(void)
539{ 540{
540 return platform_driver_probe(&omap2430_driver, omap2430_probe); 541 return platform_driver_register(&omap2430_driver);
541} 542}
542subsys_initcall(omap2430_init); 543module_init(omap2430_init);
543 544
544static void __exit omap2430_exit(void) 545static void __exit omap2430_exit(void)
545{ 546{
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index 1f405616e6cd..b387f12d05b8 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -1165,7 +1165,7 @@ static const struct musb_platform_ops tusb_ops = {
1165 1165
1166static u64 tusb_dmamask = DMA_BIT_MASK(32); 1166static u64 tusb_dmamask = DMA_BIT_MASK(32);
1167 1167
1168static int __init tusb_probe(struct platform_device *pdev) 1168static int __devinit tusb_probe(struct platform_device *pdev)
1169{ 1169{
1170 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 1170 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
1171 struct platform_device *musb; 1171 struct platform_device *musb;
@@ -1227,7 +1227,7 @@ err0:
1227 return ret; 1227 return ret;
1228} 1228}
1229 1229
1230static int __exit tusb_remove(struct platform_device *pdev) 1230static int __devexit tusb_remove(struct platform_device *pdev)
1231{ 1231{
1232 struct tusb6010_glue *glue = platform_get_drvdata(pdev); 1232 struct tusb6010_glue *glue = platform_get_drvdata(pdev);
1233 1233
@@ -1239,7 +1239,8 @@ static int __exit tusb_remove(struct platform_device *pdev)
1239} 1239}
1240 1240
1241static struct platform_driver tusb_driver = { 1241static struct platform_driver tusb_driver = {
1242 .remove = __exit_p(tusb_remove), 1242 .probe = tusb_probe,
1243 .remove = __devexit_p(tusb_remove),
1243 .driver = { 1244 .driver = {
1244 .name = "musb-tusb", 1245 .name = "musb-tusb",
1245 }, 1246 },
@@ -1251,9 +1252,9 @@ MODULE_LICENSE("GPL v2");
1251 1252
1252static int __init tusb_init(void) 1253static int __init tusb_init(void)
1253{ 1254{
1254 return platform_driver_probe(&tusb_driver, tusb_probe); 1255 return platform_driver_register(&tusb_driver);
1255} 1256}
1256subsys_initcall(tusb_init); 1257module_init(tusb_init);
1257 1258
1258static void __exit tusb_exit(void) 1259static void __exit tusb_exit(void)
1259{ 1260{
diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c
index f7e04bf34a13..bcfc48f4854a 100644
--- a/drivers/usb/musb/ux500.c
+++ b/drivers/usb/musb/ux500.c
@@ -58,7 +58,7 @@ static const struct musb_platform_ops ux500_ops = {
58 .exit = ux500_musb_exit, 58 .exit = ux500_musb_exit,
59}; 59};
60 60
61static int __init ux500_probe(struct platform_device *pdev) 61static int __devinit ux500_probe(struct platform_device *pdev)
62{ 62{
63 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 63 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
64 struct platform_device *musb; 64 struct platform_device *musb;
@@ -141,7 +141,7 @@ err0:
141 return ret; 141 return ret;
142} 142}
143 143
144static int __exit ux500_remove(struct platform_device *pdev) 144static int __devexit ux500_remove(struct platform_device *pdev)
145{ 145{
146 struct ux500_glue *glue = platform_get_drvdata(pdev); 146 struct ux500_glue *glue = platform_get_drvdata(pdev);
147 147
@@ -194,7 +194,8 @@ static const struct dev_pm_ops ux500_pm_ops = {
194#endif 194#endif
195 195
196static struct platform_driver ux500_driver = { 196static struct platform_driver ux500_driver = {
197 .remove = __exit_p(ux500_remove), 197 .probe = ux500_probe,
198 .remove = __devexit_p(ux500_remove),
198 .driver = { 199 .driver = {
199 .name = "musb-ux500", 200 .name = "musb-ux500",
200 .pm = DEV_PM_OPS, 201 .pm = DEV_PM_OPS,
@@ -207,9 +208,9 @@ MODULE_LICENSE("GPL v2");
207 208
208static int __init ux500_init(void) 209static int __init ux500_init(void)
209{ 210{
210 return platform_driver_probe(&ux500_driver, ux500_probe); 211 return platform_driver_register(&ux500_driver);
211} 212}
212subsys_initcall(ux500_init); 213module_init(ux500_init);
213 214
214static void __exit ux500_exit(void) 215static void __exit ux500_exit(void)
215{ 216{