summaryrefslogtreecommitdiff
path: root/drivers/usb/musb-new/pic32.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/musb-new/pic32.c')
-rw-r--r--drivers/usb/musb-new/pic32.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/musb-new/pic32.c b/drivers/usb/musb-new/pic32.c
index f04719d7af..3a19900e21 100644
--- a/drivers/usb/musb-new/pic32.c
+++ b/drivers/usb/musb-new/pic32.c
@@ -251,9 +251,11 @@ static int musb_usb_probe(struct udevice *dev)
ret = musb_lowlevel_init(mdata);
#else
pic32_musb_plat.mode = MUSB_PERIPHERAL;
- ret = musb_register(&pic32_musb_plat, &pdata->dev, mregs);
+ mdata->host = musb_register(&pic32_musb_plat, &pdata->dev, mregs);
+ if (!mdata->host)
+ return -EIO;
#endif
- if (ret == 0)
+ if ((ret == 0) && mdata->host)
printf("PIC32 MUSB OTG\n");
return ret;