Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm If [eo]hci_init fail then bail out and don't tr...



details:   https://anonhg.NetBSD.org/src/rev/7b9188b7a9c6
branches:  trunk
changeset: 330131:7b9188b7a9c6
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue Jun 24 05:07:31 2014 +0000

description:
If [eo]hci_init fail then bail out and don't try and attach devices.

diffstat:

 sys/arch/arm/allwinner/awin_usb.c   |   8 ++++----
 sys/arch/arm/broadcom/bcm53xx_usb.c |  15 ++++++++-------
 2 files changed, 12 insertions(+), 11 deletions(-)

diffs (67 lines):

diff -r afc433b0996f -r 7b9188b7a9c6 sys/arch/arm/allwinner/awin_usb.c
--- a/sys/arch/arm/allwinner/awin_usb.c Tue Jun 24 05:04:14 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_usb.c Tue Jun 24 05:07:31 2014 +0000
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: awin_usb.c,v 1.11 2014/06/23 07:29:42 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_usb.c,v 1.12 2014/06/24 05:07:31 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -213,10 +213,10 @@
        int error = ehci_init(sc);
        if (error != USBD_NORMAL_COMPLETION) {
                aprint_error_dev(self, "init failed, error=%d\n", error);
-       } else {
-               /* Attach usb device. */
-               sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint);
+               return;
        }
+       /* Attach usb device. */
+       sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint);
 
        const int irq = awinusb_ehci_irqs[usbaa->usbaa_port];
        usbsc->usbsc_ehci_ih = intr_establish(irq, IPL_USB,
diff -r afc433b0996f -r 7b9188b7a9c6 sys/arch/arm/broadcom/bcm53xx_usb.c
--- a/sys/arch/arm/broadcom/bcm53xx_usb.c       Tue Jun 24 05:04:14 2014 +0000
+++ b/sys/arch/arm/broadcom/bcm53xx_usb.c       Tue Jun 24 05:07:31 2014 +0000
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_usb.c,v 1.5 2014/02/19 22:21:16 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_usb.c,v 1.6 2014/06/24 05:07:31 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -125,10 +125,11 @@
        int error = ohci_init(sc);
        if (error != USBD_NORMAL_COMPLETION) {
                aprint_error_dev(self, "init failed, error=%d\n", error);
-       } else {
-               /* Attach usb device. */
-               sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint);
+               return;
        }
+
+       /* Attach usb device. */
+       sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint);
 }
 
 #ifdef EHCI_DEBUG
@@ -184,10 +185,10 @@
        int error = ehci_init(sc);
        if (error != USBD_NORMAL_COMPLETION) {
                aprint_error_dev(self, "init failed, error=%d\n", error);
-       } else {
-               /* Attach usb device. */
-               sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint);
+               return;
        }
+       /* Attach usb device. */
+       sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint);
 }
 
 /*



Home | Main Index | Thread Index | Old Index