Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/uart/uart_bus_acpi.c
Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | uart_acpi_find_device(device_t dev) | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
#endif | #endif | ||||
static int | static int | ||||
uart_acpi_probe(device_t dev) | uart_acpi_probe(device_t dev) | ||||
{ | { | ||||
struct uart_softc *sc; | struct uart_softc *sc; | ||||
device_t parent; | |||||
parent = device_get_parent(dev); | |||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
#if defined(__i386__) || defined(__amd64__) | #if defined(__i386__) || defined(__amd64__) | ||||
if (!ISA_PNP_PROBE(parent, dev, acpi_ns8250_ids)) { | if (!ISA_PNP_PROBE(device_get_parent(dev), dev, acpi_ns8250_ids)) { | ||||
sc->sc_class = &uart_ns8250_class; | sc->sc_class = &uart_ns8250_class; | ||||
return (uart_bus_probe(dev, 0, 0, 0, 0, 0)); | return (uart_bus_probe(dev, 0, 0, 0, 0, 0)); | ||||
} | } | ||||
/* Add checks for non-ns8250 IDs here. */ | /* Add checks for non-ns8250 IDs here. */ | ||||
#elif defined(__aarch64__) | #elif defined(__aarch64__) | ||||
if ((sc->sc_class = uart_acpi_find_device(dev)) != NULL) | if ((sc->sc_class = uart_acpi_find_device(dev)) != NULL) | ||||
return (uart_bus_probe(dev, 2, 0, 0, 0, 0)); | return (uart_bus_probe(dev, 2, 0, 0, 0, 0)); | ||||
#endif | #endif | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
DRIVER_MODULE(uart, acpi, uart_acpi_driver, uart_devclass, 0, 0); | DRIVER_MODULE(uart, acpi, uart_acpi_driver, uart_devclass, 0, 0); |