]> git.sur5r.net Git - u-boot/commitdiff
musb: Properly call musb_stop() on probe failure
authorHans de Goede <hdegoede@redhat.com>
Sat, 2 Apr 2016 18:46:10 +0000 (20:46 +0200)
committerMarek Vasut <marex@denx.de>
Sun, 10 Apr 2016 15:18:43 +0000 (17:18 +0200)
musb_lowlevelinit(): if no device is plugged in / detected call
musb_stop() to undo the preceding musb_start() call.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/usb/musb-new/musb_uboot.c

index 233a0e4a5e297363532c6c2bc338fe2598094581..6ce528c81ee02ed493579f91525f3f80ccf9dd7c 100644 (file)
@@ -237,8 +237,10 @@ int musb_lowlevel_init(struct musb_host_data *host)
                if (musb_readb(mbase, MUSB_DEVCTL) & MUSB_DEVCTL_HM)
                        break;
        } while (get_timer(0) < timeout);
-       if (get_timer(0) >= timeout)
+       if (get_timer(0) >= timeout) {
+               musb_stop(host->host);
                return -ENODEV;
+       }
 
        _musb_reset_root_port(host, NULL);
        host->host->is_active = 1;