When attaching pccard and cardbus children, there's no need to set the

device == NULL on failure.  A warning should suffice.

# I wrote this back before I understood the unattached but loosely bound
# newbus concept...
This commit is contained in:
Warner Losh 2004-05-21 06:11:47 +00:00
parent 2a829b00f4
commit 2a6c850c09

View File

@ -757,18 +757,14 @@ cbb_attach(device_t brdev)
sc->cbdev = device_add_child(brdev, "cardbus", -1);
if (sc->cbdev == NULL)
DEVPRINTF((brdev, "WARNING: cannot add cardbus bus.\n"));
else if (device_probe_and_attach(sc->cbdev) != 0) {
else if (device_probe_and_attach(sc->cbdev) != 0)
DEVPRINTF((brdev, "WARNING: cannot attach cardbus bus!\n"));
sc->cbdev = NULL;
}
sc->exca.pccarddev = device_add_child(brdev, "pccard", -1);
if (sc->exca.pccarddev == NULL)
DEVPRINTF((brdev, "WARNING: cannot add pccard bus.\n"));
else if (device_probe_and_attach(sc->exca.pccarddev) != 0) {
else if (device_probe_and_attach(sc->exca.pccarddev) != 0)
DEVPRINTF((brdev, "WARNING: cannot attach pccard bus.\n"));
sc->exca.pccarddev = NULL;
}
/* Map and establish the interrupt. */
rid = 0;