aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-01 11:44:20 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-01 11:44:20 -0500
commit15e68a803573974409972e761d8f08f03fce5bdb (patch)
tree5a7ff8f06da629bd59101718f27b157912c141be /drivers
parentf7c96f59b4af72f51c7835ed073da820bc3786b3 (diff)
parent39287076e46d2c19aaceaa6f0a44168ae4d257ec (diff)
Merge tag 'musb-for-v3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
USB: MUSB changes for 3.4 Here are a set of changes to the MUSB driver. In summary we have a patch making modules behave better, there's a fix on debugfs' error path, a small change removing an unnecessary pm_runtime call on musb_shutdown() and a fix to relesect the endpoint in Interrupt context. This last patch is needed because we must drop musb's lock when calling request->complete() and that could cause problems if another thread queues a request and ends up changing MUSB_INDEX register.
Diffstat (limited to 'drivers')
-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.c51
-rw-r--r--drivers/usb/musb/musb_debugfs.c14
-rw-r--r--drivers/usb/musb/musb_gadget.c24
-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, 92 insertions, 72 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 7c569f51212a..0ba3e75285cf 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -511,7 +511,7 @@ static const struct musb_platform_ops davinci_ops = {
511 511
512static u64 davinci_dmamask = DMA_BIT_MASK(32); 512static u64 davinci_dmamask = DMA_BIT_MASK(32);
513 513
514static int __init davinci_probe(struct platform_device *pdev) 514static int __devinit davinci_probe(struct platform_device *pdev)
515{ 515{
516 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 516 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
517 struct platform_device *musb; 517 struct platform_device *musb;
@@ -594,7 +594,7 @@ err0:
594 return ret; 594 return ret;
595} 595}
596 596
597static int __exit davinci_remove(struct platform_device *pdev) 597static int __devexit davinci_remove(struct platform_device *pdev)
598{ 598{
599 struct davinci_glue *glue = platform_get_drvdata(pdev); 599 struct davinci_glue *glue = platform_get_drvdata(pdev);
600 600
@@ -608,7 +608,8 @@ static int __exit davinci_remove(struct platform_device *pdev)
608} 608}
609 609
610static struct platform_driver davinci_driver = { 610static struct platform_driver davinci_driver = {
611 .remove = __exit_p(davinci_remove), 611 .probe = davinci_probe,
612 .remove = __devexit_p(davinci_remove),
612 .driver = { 613 .driver = {
613 .name = "musb-davinci", 614 .name = "musb-davinci",
614 }, 615 },
@@ -620,9 +621,9 @@ MODULE_LICENSE("GPL v2");
620 621
621static int __init davinci_init(void) 622static int __init davinci_init(void)
622{ 623{
623 return platform_driver_probe(&davinci_driver, davinci_probe); 624 return platform_driver_register(&davinci_driver);
624} 625}
625subsys_initcall(davinci_init); 626module_init(davinci_init);
626 627
627static void __exit davinci_exit(void) 628static void __exit davinci_exit(void)
628{ 629{
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 3d11cf64ebd1..3746fff628b2 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1017,12 +1017,12 @@ static void musb_shutdown(struct platform_device *pdev)
1017 || defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE) \ 1017 || defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE) \
1018 || defined(CONFIG_USB_MUSB_AM35X) \ 1018 || defined(CONFIG_USB_MUSB_AM35X) \
1019 || defined(CONFIG_USB_MUSB_AM35X_MODULE) 1019 || defined(CONFIG_USB_MUSB_AM35X_MODULE)
1020static ushort __initdata fifo_mode = 4; 1020static ushort __devinitdata fifo_mode = 4;
1021#elif defined(CONFIG_USB_MUSB_UX500) \ 1021#elif defined(CONFIG_USB_MUSB_UX500) \
1022 || defined(CONFIG_USB_MUSB_UX500_MODULE) 1022 || defined(CONFIG_USB_MUSB_UX500_MODULE)
1023static ushort __initdata fifo_mode = 5; 1023static ushort __devinitdata fifo_mode = 5;
1024#else 1024#else
1025static ushort __initdata fifo_mode = 2; 1025static ushort __devinitdata fifo_mode = 2;
1026#endif 1026#endif
1027 1027
1028/* "modprobe ... fifo_mode=1" etc */ 1028/* "modprobe ... fifo_mode=1" etc */
@@ -1035,7 +1035,7 @@ MODULE_PARM_DESC(fifo_mode, "initial endpoint configuration");
1035 */ 1035 */
1036 1036
1037/* mode 0 - fits in 2KB */ 1037/* mode 0 - fits in 2KB */
1038static struct musb_fifo_cfg __initdata mode_0_cfg[] = { 1038static struct musb_fifo_cfg __devinitdata mode_0_cfg[] = {
1039{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, 1039{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
1040{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, 1040{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
1041{ .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, }, 1041{ .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, },
@@ -1044,7 +1044,7 @@ static struct musb_fifo_cfg __initdata mode_0_cfg[] = {
1044}; 1044};
1045 1045
1046/* mode 1 - fits in 4KB */ 1046/* mode 1 - fits in 4KB */
1047static struct musb_fifo_cfg __initdata mode_1_cfg[] = { 1047static struct musb_fifo_cfg __devinitdata mode_1_cfg[] = {
1048{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, }, 1048{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, },
1049{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, }, 1049{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, },
1050{ .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, .mode = BUF_DOUBLE, }, 1050{ .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, .mode = BUF_DOUBLE, },
@@ -1053,7 +1053,7 @@ static struct musb_fifo_cfg __initdata mode_1_cfg[] = {
1053}; 1053};
1054 1054
1055/* mode 2 - fits in 4KB */ 1055/* mode 2 - fits in 4KB */
1056static struct musb_fifo_cfg __initdata mode_2_cfg[] = { 1056static struct musb_fifo_cfg __devinitdata mode_2_cfg[] = {
1057{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, 1057{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
1058{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, 1058{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
1059{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, 1059{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
@@ -1063,7 +1063,7 @@ static struct musb_fifo_cfg __initdata mode_2_cfg[] = {
1063}; 1063};
1064 1064
1065/* mode 3 - fits in 4KB */ 1065/* mode 3 - fits in 4KB */
1066static struct musb_fifo_cfg __initdata mode_3_cfg[] = { 1066static struct musb_fifo_cfg __devinitdata mode_3_cfg[] = {
1067{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, }, 1067{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, },
1068{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, }, 1068{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, },
1069{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, 1069{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
@@ -1073,7 +1073,7 @@ static struct musb_fifo_cfg __initdata mode_3_cfg[] = {
1073}; 1073};
1074 1074
1075/* mode 4 - fits in 16KB */ 1075/* mode 4 - fits in 16KB */
1076static struct musb_fifo_cfg __initdata mode_4_cfg[] = { 1076static struct musb_fifo_cfg __devinitdata mode_4_cfg[] = {
1077{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, 1077{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
1078{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, 1078{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
1079{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, 1079{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
@@ -1104,7 +1104,7 @@ static struct musb_fifo_cfg __initdata mode_4_cfg[] = {
1104}; 1104};
1105 1105
1106/* mode 5 - fits in 8KB */ 1106/* mode 5 - fits in 8KB */
1107static struct musb_fifo_cfg __initdata mode_5_cfg[] = { 1107static struct musb_fifo_cfg __devinitdata mode_5_cfg[] = {
1108{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, 1108{ .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
1109{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, 1109{ .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
1110{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, 1110{ .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
@@ -1140,7 +1140,7 @@ static struct musb_fifo_cfg __initdata mode_5_cfg[] = {
1140 * 1140 *
1141 * returns negative errno or offset for next fifo. 1141 * returns negative errno or offset for next fifo.
1142 */ 1142 */
1143static int __init 1143static int __devinit
1144fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep, 1144fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep,
1145 const struct musb_fifo_cfg *cfg, u16 offset) 1145 const struct musb_fifo_cfg *cfg, u16 offset)
1146{ 1146{
@@ -1211,11 +1211,11 @@ fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep,
1211 return offset + (maxpacket << ((c_size & MUSB_FIFOSZ_DPB) ? 1 : 0)); 1211 return offset + (maxpacket << ((c_size & MUSB_FIFOSZ_DPB) ? 1 : 0));
1212} 1212}
1213 1213
1214static struct musb_fifo_cfg __initdata ep0_cfg = { 1214static struct musb_fifo_cfg __devinitdata ep0_cfg = {
1215 .style = FIFO_RXTX, .maxpacket = 64, 1215 .style = FIFO_RXTX, .maxpacket = 64,
1216}; 1216};
1217 1217
1218static int __init ep_config_from_table(struct musb *musb) 1218static int __devinit ep_config_from_table(struct musb *musb)
1219{ 1219{
1220 const struct musb_fifo_cfg *cfg; 1220 const struct musb_fifo_cfg *cfg;
1221 unsigned i, n; 1221 unsigned i, n;
@@ -1306,7 +1306,7 @@ done:
1306 * ep_config_from_hw - when MUSB_C_DYNFIFO_DEF is false 1306 * ep_config_from_hw - when MUSB_C_DYNFIFO_DEF is false
1307 * @param musb the controller 1307 * @param musb the controller
1308 */ 1308 */
1309static int __init ep_config_from_hw(struct musb *musb) 1309static int __devinit ep_config_from_hw(struct musb *musb)
1310{ 1310{
1311 u8 epnum = 0; 1311 u8 epnum = 0;
1312 struct musb_hw_ep *hw_ep; 1312 struct musb_hw_ep *hw_ep;
@@ -1353,7 +1353,7 @@ enum { MUSB_CONTROLLER_MHDRC, MUSB_CONTROLLER_HDRC, };
1353/* Initialize MUSB (M)HDRC part of the USB hardware subsystem; 1353/* Initialize MUSB (M)HDRC part of the USB hardware subsystem;
1354 * configure endpoints, or take their config from silicon 1354 * configure endpoints, or take their config from silicon
1355 */ 1355 */
1356static int __init musb_core_init(u16 musb_type, struct musb *musb) 1356static int __devinit musb_core_init(u16 musb_type, struct musb *musb)
1357{ 1357{
1358 u8 reg; 1358 u8 reg;
1359 char *type; 1359 char *type;
@@ -1589,7 +1589,7 @@ irqreturn_t musb_interrupt(struct musb *musb)
1589EXPORT_SYMBOL_GPL(musb_interrupt); 1589EXPORT_SYMBOL_GPL(musb_interrupt);
1590 1590
1591#ifndef CONFIG_MUSB_PIO_ONLY 1591#ifndef CONFIG_MUSB_PIO_ONLY
1592static bool __initdata use_dma = 1; 1592static bool __devinitdata use_dma = 1;
1593 1593
1594/* "modprobe ... use_dma=0" etc */ 1594/* "modprobe ... use_dma=0" etc */
1595module_param(use_dma, bool, 0); 1595module_param(use_dma, bool, 0);
@@ -1777,7 +1777,7 @@ static void musb_irq_work(struct work_struct *data)
1777 * Init support 1777 * Init support
1778 */ 1778 */
1779 1779
1780static struct musb *__init 1780static struct musb *__devinit
1781allocate_instance(struct device *dev, 1781allocate_instance(struct device *dev,
1782 struct musb_hdrc_config *config, void __iomem *mbase) 1782 struct musb_hdrc_config *config, void __iomem *mbase)
1783{ 1783{
@@ -1853,7 +1853,7 @@ static void musb_free(struct musb *musb)
1853 * @mregs: virtual address of controller registers, 1853 * @mregs: virtual address of controller registers,
1854 * not yet corrected for platform-specific offsets 1854 * not yet corrected for platform-specific offsets
1855 */ 1855 */
1856static int __init 1856static int __devinit
1857musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) 1857musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
1858{ 1858{
1859 int status; 1859 int status;
@@ -2073,7 +2073,7 @@ fail0:
2073static u64 *orig_dma_mask; 2073static u64 *orig_dma_mask;
2074#endif 2074#endif
2075 2075
2076static int __init musb_probe(struct platform_device *pdev) 2076static int __devinit musb_probe(struct platform_device *pdev)
2077{ 2077{
2078 struct device *dev = &pdev->dev; 2078 struct device *dev = &pdev->dev;
2079 int irq = platform_get_irq_byname(pdev, "mc"); 2079 int irq = platform_get_irq_byname(pdev, "mc");
@@ -2102,7 +2102,7 @@ static int __init musb_probe(struct platform_device *pdev)
2102 return status; 2102 return status;
2103} 2103}
2104 2104
2105static int __exit musb_remove(struct platform_device *pdev) 2105static int __devexit musb_remove(struct platform_device *pdev)
2106{ 2106{
2107 struct musb *musb = dev_to_musb(&pdev->dev); 2107 struct musb *musb = dev_to_musb(&pdev->dev);
2108 void __iomem *ctrl_base = musb->ctrl_base; 2108 void __iomem *ctrl_base = musb->ctrl_base;
@@ -2112,11 +2112,9 @@ static int __exit musb_remove(struct platform_device *pdev)
2112 * - Peripheral mode: peripheral is deactivated (or never-activated) 2112 * - Peripheral mode: peripheral is deactivated (or never-activated)
2113 * - OTG mode: both roles are deactivated (or never-activated) 2113 * - OTG mode: both roles are deactivated (or never-activated)
2114 */ 2114 */
2115 pm_runtime_get_sync(musb->controller);
2116 musb_exit_debugfs(musb); 2115 musb_exit_debugfs(musb);
2117 musb_shutdown(pdev); 2116 musb_shutdown(pdev);
2118 2117
2119 pm_runtime_put(musb->controller);
2120 musb_free(musb); 2118 musb_free(musb);
2121 iounmap(ctrl_base); 2119 iounmap(ctrl_base);
2122 device_init_wakeup(&pdev->dev, 0); 2120 device_init_wakeup(&pdev->dev, 0);
@@ -2364,7 +2362,8 @@ static struct platform_driver musb_driver = {
2364 .owner = THIS_MODULE, 2362 .owner = THIS_MODULE,
2365 .pm = MUSB_DEV_PM_OPS, 2363 .pm = MUSB_DEV_PM_OPS,
2366 }, 2364 },
2367 .remove = __exit_p(musb_remove), 2365 .probe = musb_probe,
2366 .remove = __devexit_p(musb_remove),
2368 .shutdown = musb_shutdown, 2367 .shutdown = musb_shutdown,
2369}; 2368};
2370 2369
@@ -2380,13 +2379,9 @@ static int __init musb_init(void)
2380 ", " 2379 ", "
2381 "otg (peripheral+host)", 2380 "otg (peripheral+host)",
2382 musb_driver_name); 2381 musb_driver_name);
2383 return platform_driver_probe(&musb_driver, musb_probe); 2382 return platform_driver_register(&musb_driver);
2384} 2383}
2385 2384module_init(musb_init);
2386/* make us init after usbcore and i2c (transceivers, regulators, etc)
2387 * and before usb gadget and host-side drivers start to register
2388 */
2389fs_initcall(musb_init);
2390 2385
2391static void __exit musb_cleanup(void) 2386static void __exit musb_cleanup(void)
2392{ 2387{
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c
index 13d9af9bf920..40a37c91cc10 100644
--- a/drivers/usb/musb/musb_debugfs.c
+++ b/drivers/usb/musb/musb_debugfs.c
@@ -235,29 +235,29 @@ 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;
242 int ret; 242 int ret;
243 243
244 root = debugfs_create_dir("musb", NULL); 244 root = debugfs_create_dir("musb", NULL);
245 if (IS_ERR(root)) { 245 if (!root) {
246 ret = PTR_ERR(root); 246 ret = -ENOMEM;
247 goto err0; 247 goto err0;
248 } 248 }
249 249
250 file = debugfs_create_file("regdump", S_IRUGO, root, musb, 250 file = debugfs_create_file("regdump", S_IRUGO, root, musb,
251 &musb_regdump_fops); 251 &musb_regdump_fops);
252 if (IS_ERR(file)) { 252 if (!file) {
253 ret = PTR_ERR(file); 253 ret = -ENOMEM;
254 goto err1; 254 goto err1;
255 } 255 }
256 256
257 file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR, 257 file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR,
258 root, musb, &musb_test_mode_fops); 258 root, musb, &musb_test_mode_fops);
259 if (IS_ERR(file)) { 259 if (!file) {
260 ret = PTR_ERR(file); 260 ret = -ENOMEM;
261 goto err1; 261 goto err1;
262 } 262 }
263 263
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index ac3d2eec20fe..957d9ca3d06d 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -574,6 +574,15 @@ void musb_g_tx(struct musb *musb, u8 epnum)
574 574
575 if (request->actual == request->length) { 575 if (request->actual == request->length) {
576 musb_g_giveback(musb_ep, request, 0); 576 musb_g_giveback(musb_ep, request, 0);
577 /*
578 * In the giveback function the MUSB lock is
579 * released and acquired after sometime. During
580 * this time period the INDEX register could get
581 * changed by the gadget_queue function especially
582 * on SMP systems. Reselect the INDEX to be sure
583 * we are reading/modifying the right registers
584 */
585 musb_ep_select(mbase, epnum);
577 req = musb_ep->desc ? next_request(musb_ep) : NULL; 586 req = musb_ep->desc ? next_request(musb_ep) : NULL;
578 if (!req) { 587 if (!req) {
579 dev_dbg(musb->controller, "%s idle now\n", 588 dev_dbg(musb->controller, "%s idle now\n",
@@ -983,6 +992,15 @@ void musb_g_rx(struct musb *musb, u8 epnum)
983 } 992 }
984#endif 993#endif
985 musb_g_giveback(musb_ep, request, 0); 994 musb_g_giveback(musb_ep, request, 0);
995 /*
996 * In the giveback function the MUSB lock is
997 * released and acquired after sometime. During
998 * this time period the INDEX register could get
999 * changed by the gadget_queue function especially
1000 * on SMP systems. Reselect the INDEX to be sure
1001 * we are reading/modifying the right registers
1002 */
1003 musb_ep_select(mbase, epnum);
986 1004
987 req = next_request(musb_ep); 1005 req = next_request(musb_ep);
988 if (!req) 1006 if (!req)
@@ -1762,7 +1780,7 @@ static void musb_gadget_release(struct device *dev)
1762} 1780}
1763 1781
1764 1782
1765static void __init 1783static void __devinit
1766init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) 1784init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in)
1767{ 1785{
1768 struct musb_hw_ep *hw_ep = musb->endpoints + epnum; 1786 struct musb_hw_ep *hw_ep = musb->endpoints + epnum;
@@ -1799,7 +1817,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 1817 * Initialize the endpoints exposed to peripheral drivers, with backlinks
1800 * to the rest of the driver state. 1818 * to the rest of the driver state.
1801 */ 1819 */
1802static inline void __init musb_g_init_endpoints(struct musb *musb) 1820static inline void __devinit musb_g_init_endpoints(struct musb *musb)
1803{ 1821{
1804 u8 epnum; 1822 u8 epnum;
1805 struct musb_hw_ep *hw_ep; 1823 struct musb_hw_ep *hw_ep;
@@ -1832,7 +1850,7 @@ static inline void __init musb_g_init_endpoints(struct musb *musb)
1832/* called once during driver setup to initialize and link into 1850/* called once during driver setup to initialize and link into
1833 * the driver model; memory is zeroed. 1851 * the driver model; memory is zeroed.
1834 */ 1852 */
1835int __init musb_gadget_setup(struct musb *musb) 1853int __devinit musb_gadget_setup(struct musb *musb)
1836{ 1854{
1837 int status; 1855 int status;
1838 1856
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index df719eae3b03..da430c31ebef 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{