mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Set the device description after we call uart_probe(). In uart_probe()
we call device-specific probe functions, which can (and typically will) set the device description based on low-level device probe information. In the end we never actually used the device description that we so carefully maintained in the PCI match table. By setting the device description after we call uart_probe(), we'll print the more user- friendly description by default.
This commit is contained in:
parent
ba90c51af3
commit
a177309ff9
1 changed files with 7 additions and 1 deletions
|
|
@ -162,6 +162,7 @@ uart_pci_probe(device_t dev)
|
|||
{
|
||||
struct uart_softc *sc;
|
||||
const struct pci_id *id;
|
||||
int result;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
|
||||
|
|
@ -174,9 +175,14 @@ uart_pci_probe(device_t dev)
|
|||
return (ENXIO);
|
||||
|
||||
match:
|
||||
result = uart_bus_probe(dev, 0, id->rclk, id->rid, 0);
|
||||
/* Bail out on error. */
|
||||
if (result > 0)
|
||||
return (result);
|
||||
/* Set/override the device description. */
|
||||
if (id->desc)
|
||||
device_set_desc(dev, id->desc);
|
||||
return (uart_bus_probe(dev, 0, id->rclk, id->rid, 0));
|
||||
return (result);
|
||||
}
|
||||
|
||||
DRIVER_MODULE(uart, pci, uart_pci_driver, uart_devclass, NULL, NULL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue