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:
Josef Karthauser 2002-08-18 11:42:11 +00:00
parent 62f7648682
commit f992fafdd7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=102055
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 {
break;
default:
if (bootverbose)
device_printf(self, "(New UHCI DeviceId=0x%08x)\n",
pci_get_devid(self));
sprintf(sc->sc_vendor, "(0x%08x)", 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 {
break;
default:
if (bootverbose)
device_printf(self, "(New UHCI DeviceId=0x%08x)\n",
pci_get_devid(self));
sprintf(sc->sc_vendor, "(0x%08x)", 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) {