summaryrefslogtreecommitdiffstats
path: root/sys/pci/uhci_pci.c
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>2000-01-26 10:52:27 +0000
committern_hibma <n_hibma@FreeBSD.org>2000-01-26 10:52:27 +0000
commit7e6dc4529230f1440c8b7791225edfcf25ca8138 (patch)
tree3f133a3ae5d52f9546635f3b08283ebc3f519e46 /sys/pci/uhci_pci.c
parent9fec7300da18347dcd4ac41caedf8b4d7fdc1667 (diff)
downloadFreeBSD-src-7e6dc4529230f1440c8b7791225edfcf25ca8138.zip
FreeBSD-src-7e6dc4529230f1440c8b7791225edfcf25ca8138.tar.gz
Properly teardown the allocated and initialised stuff when an error
occurs (OHCIwas already done for UHCI). Get rid of the usbus variable. It is confusing. Align uhci_pci.c and ohci_pci.c again.
Diffstat (limited to 'sys/pci/uhci_pci.c')
-rw-r--r--sys/pci/uhci_pci.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/pci/uhci_pci.c b/sys/pci/uhci_pci.c
index d342c81..f12355c 100644
--- a/sys/pci/uhci_pci.c
+++ b/sys/pci/uhci_pci.c
@@ -252,8 +252,8 @@ uhci_pci_attach(device_t self)
err = device_probe_and_attach(sc->sc_bus.bdev);
if (err) {
- device_printf(self, "init failed\n");
- err = EIO; /* XXX arbitrary value */
+ device_printf(self, "USB init failed\n");
+ err = EIO;
goto bad4;
}
@@ -261,7 +261,7 @@ uhci_pci_attach(device_t self)
bad4:
/* disable interrupts that might have been switched on
- * in uhci_init
+ * in uhci_init.
*/
bus_space_write_2(sc->iot, sc->ioh, UHCI_INTR, 0);
@@ -274,11 +274,9 @@ bad4:
bad3:
device_delete_child(self, sc->sc_bus.bdev);
bad2:
- rid = 0;
- bus_delete_resource(self, SYS_RES_IRQ, rid);
+ bus_delete_resource(self, SYS_RES_IRQ, 0);
bad1:
- rid = PCI_UHCI_BASE_REG;
- bus_delete_resource(self, SYS_RES_IOPORT, rid);
+ bus_delete_resource(self, SYS_RES_IOPORT, PCI_UHCI_BASE_REG);
return err;
}
OpenPOWER on IntegriCloud