diff options
author | Michael Knudsen <mk@cvs.openbsd.org> | 2010-10-20 20:34:20 +0000 |
---|---|---|
committer | Michael Knudsen <mk@cvs.openbsd.org> | 2010-10-20 20:34:20 +0000 |
commit | 9203a381ec3b797ba691eb3d0ec82e6dc5791679 (patch) | |
tree | cba259d1d3d870130eb3ce79d21383ce612c6146 /sys | |
parent | 0fffb28f6e8c9441afef22a29b46721b20442146 (diff) |
Disestablish interrupts if attachment fails.
ok jakemsr
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/ehci_pci.c | 8 | ||||
-rw-r--r-- | sys/dev/pci/ohci_pci.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/uhci_pci.c | 3 |
3 files changed, 10 insertions, 5 deletions
diff --git a/sys/dev/pci/ehci_pci.c b/sys/dev/pci/ehci_pci.c index 75260e780bd..0ea329aa567 100644 --- a/sys/dev/pci/ehci_pci.c +++ b/sys/dev/pci/ehci_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ehci_pci.c,v 1.21 2010/08/08 04:19:24 deraadt Exp $ */ +/* $OpenBSD: ehci_pci.c,v 1.22 2010/10/20 20:34:19 mk Exp $ */ /* $NetBSD: ehci_pci.c,v 1.15 2004/04/23 21:13:06 itojun Exp $ */ /* @@ -186,7 +186,7 @@ ehci_pci_attach(struct device *parent, struct device *self, void *aux) case PCI_USBREV_1_1: sc->sc.sc_bus.usbrev = USBREV_UNKNOWN; printf("%s: pre-2.0 USB rev\n", devname); - goto unmap_ret; + goto disestablish_ret; case PCI_USBREV_2_0: sc->sc.sc_bus.usbrev = USBREV_2_0; break; @@ -212,7 +212,7 @@ ehci_pci_attach(struct device *parent, struct device *self, void *aux) r = ehci_init(&sc->sc); if (r != USBD_NORMAL_COMPLETION) { printf("%s: init failed, error=%d\n", devname, r); - goto unmap_ret; + goto disestablish_ret; } sc->sc.sc_shutdownhook = shutdownhook_establish(ehci_pci_shutdown, sc); @@ -224,6 +224,8 @@ ehci_pci_attach(struct device *parent, struct device *self, void *aux) return; +disestablish_ret: + pci_intr_disestablish(sc->sc_pc, sc->sc_ih); unmap_ret: bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size); splx(s); diff --git a/sys/dev/pci/ohci_pci.c b/sys/dev/pci/ohci_pci.c index dda8650d4d0..c99ffb9276d 100644 --- a/sys/dev/pci/ohci_pci.c +++ b/sys/dev/pci/ohci_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ohci_pci.c,v 1.36 2010/09/07 16:21:45 deraadt Exp $ */ +/* $OpenBSD: ohci_pci.c,v 1.37 2010/10/20 20:34:19 mk Exp $ */ /* $NetBSD: ohci_pci.c,v 1.23 2002/10/02 16:51:47 thorpej Exp $ */ /* @@ -156,6 +156,7 @@ ohci_pci_attach(struct device *parent, struct device *self, void *aux) if (ohci_checkrev(&sc->sc) != USBD_NORMAL_COMPLETION || ohci_handover(&sc->sc) != USBD_NORMAL_COMPLETION) { bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size); + pci_intr_disestablish(sc->sc_pc, sc->sc_ih); splx(s); return; } @@ -186,6 +187,7 @@ ohci_pci_attach_deferred(struct device *self) printf("%s: init failed, error=%d\n", sc->sc.sc_bus.bdev.dv_xname, r); bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size); + pci_intr_disestablish(sc->sc_pc, sc->sc_ih); splx(s); return; } diff --git a/sys/dev/pci/uhci_pci.c b/sys/dev/pci/uhci_pci.c index ae278764663..1ca8ec4b610 100644 --- a/sys/dev/pci/uhci_pci.c +++ b/sys/dev/pci/uhci_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhci_pci.c,v 1.29 2010/06/29 22:14:57 mlarkin Exp $ */ +/* $OpenBSD: uhci_pci.c,v 1.30 2010/10/20 20:34:19 mk Exp $ */ /* $NetBSD: uhci_pci.c,v 1.24 2002/10/02 16:51:58 thorpej Exp $ */ /* @@ -219,6 +219,7 @@ uhci_pci_attach_deferred(struct device *self) unmap_ret: bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size); + pci_intr_disestablish(sc->sc_pc, sc->sc_ih); splx(s); } |