Add a comment to remind that uhci_pci_match will never return NULL.

Don't display the "New UHCI DeviceId" message unless booting verbosely.
Use a switch statement for the vendor match code.
This commit is contained in:
joe 2002-08-18 11:42:11 +00:00
parent f6cebc0606
commit 34ab7e6f06
2 changed files with 22 additions and 12 deletions

View File

@ -250,15 +250,20 @@ uhci_pci_attach(device_t self)
}
device_set_ivars(sc->sc_bus.bdev, sc);
/* uhci_pci_match must never return NULL if uhci_pci_probe succeeded */
device_set_desc(sc->sc_bus.bdev, uhci_pci_match(self));
if (pci_get_vendor(self) == PCI_UHCI_VENDORID_INTEL) {
switch (pci_get_vendor(self)) {
case PCI_UHCI_VENDORID_INTEL:
sprintf(sc->sc_vendor, "Intel");
} else if (pci_get_vendor(self) == PCI_UHCI_VENDORID_VIA) {
break;
case PCI_UHCI_VENDORID_VIA:
sprintf(sc->sc_vendor, "VIA");
} else {
device_printf(self, "(New UHCI DeviceId=0x%08x)\n",
pci_get_devid(self));
sprintf(sc->sc_vendor, "(0x%08x)", pci_get_devid(self));
break;
default:
if (bootverbose)
device_printf(self, "(New UHCI DeviceId=0x%08x)\n",
pci_get_devid(self));
sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self));
}
switch (pci_read_config(self, PCI_USBREV, 4) & PCI_USBREV_MASK) {

View File

@ -250,15 +250,20 @@ uhci_pci_attach(device_t self)
}
device_set_ivars(sc->sc_bus.bdev, sc);
/* uhci_pci_match must never return NULL if uhci_pci_probe succeeded */
device_set_desc(sc->sc_bus.bdev, uhci_pci_match(self));
if (pci_get_vendor(self) == PCI_UHCI_VENDORID_INTEL) {
switch (pci_get_vendor(self)) {
case PCI_UHCI_VENDORID_INTEL:
sprintf(sc->sc_vendor, "Intel");
} else if (pci_get_vendor(self) == PCI_UHCI_VENDORID_VIA) {
break;
case PCI_UHCI_VENDORID_VIA:
sprintf(sc->sc_vendor, "VIA");
} else {
device_printf(self, "(New UHCI DeviceId=0x%08x)\n",
pci_get_devid(self));
sprintf(sc->sc_vendor, "(0x%08x)", pci_get_devid(self));
break;
default:
if (bootverbose)
device_printf(self, "(New UHCI DeviceId=0x%08x)\n",
pci_get_devid(self));
sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self));
}
switch (pci_read_config(self, PCI_USBREV, 4) & PCI_USBREV_MASK) {