]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/usb/musb/omap2430.c
usb: musb: fix dependency on transceiver driver
[karo-tx-linux.git] / drivers / usb / musb / omap2430.c
index da00af46079469df59bc2babd1bf39f1a48b885a..b15bb05dc5e86061a1fddc6e83e9875e76e336b3 100644 (file)
@@ -255,11 +255,11 @@ static inline void omap2430_low_level_init(struct musb *musb)
 void omap_musb_mailbox(enum omap_musb_vbus_id_status status)
 {
        struct omap2430_glue    *glue = _glue;
-       struct musb             *musb = glue_to_musb(glue);
 
-       glue->status = status;
-       if (!musb) {
-               dev_err(glue->dev, "musb core is not yet ready\n");
+       if (glue && glue_to_musb(glue)) {
+               glue->status = status;
+       } else {
+               pr_err("%s: musb core is not yet ready\n", __func__);
                return;
        }
 
@@ -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;
@@ -532,15 +532,13 @@ static int omap2430_probe(struct platform_device *pdev)
                if (!pdata) {
                        dev_err(&pdev->dev,
                                "failed to allocate musb platfrom data\n");
-                       ret = -ENOMEM;
                        goto err2;
                }
 
                data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
                if (!data) {
                        dev_err(&pdev->dev,
-                                       "failed to allocate musb board data\n");
-                       ret = -ENOMEM;
+                               "failed to allocate musb board data\n");
                        goto err2;
                }