diff options
| author | Josef Karthauser <joe@FreeBSD.org> | 2002-08-18 11:42:11 +0000 |
|---|---|---|
| committer | Josef Karthauser <joe@FreeBSD.org> | 2002-08-18 11:42:11 +0000 |
| commit | f992fafdd75e9463d654e73b033c24cad3b42453 (patch) | |
| tree | 36d770d4b836f1cd41dbc38867cd3408853d1a88 | |
| parent | 62f76486821669cfb9ceafa372dcdc7eb15d4e3c (diff) | |
Notes
| -rw-r--r-- | sys/dev/usb/uhci_pci.c | 17 | ||||
| -rw-r--r-- | sys/pci/uhci_pci.c | 17 |
2 files changed, 22 insertions, 12 deletions
diff --git a/sys/dev/usb/uhci_pci.c b/sys/dev/usb/uhci_pci.c index 2cf94050abad..961de65f467d 100644 --- a/sys/dev/usb/uhci_pci.c +++ b/sys/dev/usb/uhci_pci.c @@ -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) { diff --git a/sys/pci/uhci_pci.c b/sys/pci/uhci_pci.c index 2cf94050abad..961de65f467d 100644 --- a/sys/pci/uhci_pci.c +++ b/sys/pci/uhci_pci.c @@ -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) { |
