]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
usb: musb: fix dependency on transceiver driver
authorMing Lei <ming.lei@canonical.com>
Fri, 4 Jan 2013 15:13:58 +0000 (23:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Feb 2013 13:38:42 +0000 (05:38 -0800)
commit 25736e0c8269e9613aa6036fbc591818daa30d14 upstream.

This patch let glue driver return -EPROBE_DEFER if the transceiver
is not readly, so we can support defer probe on musb to fix the
below error on 3.7-rc5 if transceiver drivers are built as module:

[   19.052490] unable to find transceiver of type USB2 PHY
[   19.072052] HS USB OTG: no transceiver configured
[   19.076995] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with status -19
[   19.089355] musb-hdrc: probe of musb-hdrc.0.auto rejects match -19
[   19.096771] driver: 'musb-omap2430': driver_bound: bound to device 'musb-omap2430'
[   19.105194] bus: 'platform': really_probe: bound device musb-omap2430 to driver musb-omap2430
[   19.174407] bus: 'platform': add driver twl4030_usb
[   19.179656] bus: 'platform': driver_probe_device: matched device twl4030_usb with driver twl4030_usb
[   19.202270] bus: 'platform': really_probe: probing driver twl4030_usb with device twl4030_usb
[   19.214172] twl4030_usb twl4030_usb: HW_CONDITIONS 0xc0/192; link 3
[   19.239624] musb-omap2430 musb-omap2430: musb core is not yet ready
[   19.246765] twl4030_usb twl4030_usb: Initialized TWL4030 USB module
[   19.254516] driver: 'twl4030_usb': driver_bound: bound to device 'twl4030_usb'
[   19.263580] bus: 'platform': really_probe: bound device twl4030_usb to driver twl4030_usb

Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/am35x.c
drivers/usb/musb/blackfin.c
drivers/usb/musb/da8xx.c
drivers/usb/musb/davinci.c
drivers/usb/musb/musb_dsps.c
drivers/usb/musb/omap2430.c
drivers/usb/musb/tusb6010.c
drivers/usb/musb/ux500.c

index c107d7cdfa6962049f7af975ef4281e2a90c98ef..59eea219034a0252420b1f2248d80d33753fa9b5 100644 (file)
@@ -365,7 +365,7 @@ static int am35x_musb_init(struct musb *musb)
        usb_nop_xceiv_register();
        musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
        if (IS_ERR_OR_NULL(musb->xceiv))
-               return -ENODEV;
+               return -EPROBE_DEFER;
 
        setup_timer(&otg_workaround, otg_timer, (unsigned long) musb);
 
index 14dab9f9b3d06c0cdfc22a5861d8a3153606fbbd..dbb31b30c7fa6505da81a065ebc499d824706dcd 100644 (file)
@@ -406,7 +406,7 @@ static int bfin_musb_init(struct musb *musb)
        musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
        if (IS_ERR_OR_NULL(musb->xceiv)) {
                gpio_free(musb->config->gpio_vrsel);
-               return -ENODEV;
+               return -EPROBE_DEFER;
        }
 
        bfin_musb_reg_init(musb);
index 97996af2646eae9a2950e857652873186aea57c9..7c71769d71ff37370e6e8bf23be5c837bd72a677 100644 (file)
@@ -410,6 +410,7 @@ static int da8xx_musb_init(struct musb *musb)
 {
        void __iomem *reg_base = musb->ctrl_base;
        u32 rev;
+       int ret = -ENODEV;
 
        musb->mregs += DA8XX_MENTOR_CORE_OFFSET;
 
@@ -420,8 +421,10 @@ static int da8xx_musb_init(struct musb *musb)
 
        usb_nop_xceiv_register();
        musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
-       if (IS_ERR_OR_NULL(musb->xceiv))
+       if (IS_ERR_OR_NULL(musb->xceiv)) {
+               ret = -EPROBE_DEFER;
                goto fail;
+       }
 
        setup_timer(&otg_workaround, otg_timer, (unsigned long)musb);
 
@@ -441,7 +444,7 @@ static int da8xx_musb_init(struct musb *musb)
        musb->isr = da8xx_musb_interrupt;
        return 0;
 fail:
-       return -ENODEV;
+       return ret;
 }
 
 static int da8xx_musb_exit(struct musb *musb)
index b1c01cad28b26183a6201e70394a4097d7d1bd35..e040d9103735181aa03f4f7bd24eabbaf12f8b78 100644 (file)
@@ -380,11 +380,14 @@ static int davinci_musb_init(struct musb *musb)
 {
        void __iomem    *tibase = musb->ctrl_base;
        u32             revision;
+       int             ret = -ENODEV;
 
        usb_nop_xceiv_register();
        musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
-       if (IS_ERR_OR_NULL(musb->xceiv))
+       if (IS_ERR_OR_NULL(musb->xceiv)) {
+               ret = -EPROBE_DEFER;
                goto unregister;
+       }
 
        musb->mregs += DAVINCI_BASE_OFFSET;
 
@@ -438,7 +441,7 @@ fail:
        usb_put_phy(musb->xceiv);
 unregister:
        usb_nop_xceiv_unregister();
-       return -ENODEV;
+       return ret;
 }
 
 static int davinci_musb_exit(struct musb *musb)
index f7d764de6fdab988bde6124a8a9cd8657a0ea0ff..341a4b54448fd47e81802aa2004272037b1cfeea 100644 (file)
@@ -419,7 +419,7 @@ static int dsps_musb_init(struct musb *musb)
        usb_nop_xceiv_register();
        musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
        if (IS_ERR_OR_NULL(musb->xceiv))
-               return -ENODEV;
+               return -EPROBE_DEFER;
 
        /* Returns zero if e.g. not clocked */
        rev = dsps_readl(reg_base, wrp->revision);
index da00af46079469df59bc2babd1bf39f1a48b885a..d7772856bf4af6fb2f00dc2002df188f5f306739 100644 (file)
@@ -369,7 +369,7 @@ static int omap2430_musb_init(struct musb *musb)
        musb->xceiv = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
        if (IS_ERR_OR_NULL(musb->xceiv)) {
                pr_err("HS USB OTG: no transceiver configured\n");
-               return -ENODEV;
+               return -EPROBE_DEFER;
        }
 
        musb->isr = omap2430_musb_interrupt;
index 3969813c217d2d2af276c8f6e49b234b59a3aa22..464bd23cccda0cf04bca5fe3e8d4e0d3bde56201 100644 (file)
@@ -1069,7 +1069,7 @@ static int tusb_musb_init(struct musb *musb)
        usb_nop_xceiv_register();
        musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
        if (IS_ERR_OR_NULL(musb->xceiv))
-               return -ENODEV;
+               return -EPROBE_DEFER;
 
        pdev = to_platform_device(musb->controller);
 
index a27ca1a9c9946bd9157238b580738db34e17e302..00660fbb8c7a95dc3b0a1923a20b7950dba1c959 100644 (file)
@@ -61,7 +61,7 @@ static int ux500_musb_init(struct musb *musb)
        musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
        if (IS_ERR_OR_NULL(musb->xceiv)) {
                pr_err("HS USB OTG: no transceiver configured\n");
-               return -ENODEV;
+               return -EPROBE_DEFER;
        }
 
        musb->isr = ux500_musb_interrupt;