diff --git a/sys/dev/uart/uart_dev_snps.c b/sys/dev/uart/uart_dev_snps.c --- a/sys/dev/uart/uart_dev_snps.c +++ b/sys/dev/uart/uart_dev_snps.c @@ -223,6 +223,22 @@ return (BUS_PROBE_VENDOR); } +static int +snps_attach(device_t dev) +{ + phandle_t node; + int ret; + + ret = uart_bus_attach(dev); + if (ret == 0) { + node = ofw_bus_get_node(dev); + /* Set up phandle to dev mapping */ + OF_device_register_xref(OF_xref_from_node(node), dev); + } + + return (ret); +} + static int snps_detach(device_t dev) { @@ -269,7 +285,7 @@ static device_method_t snps_bus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, snps_probe), - DEVMETHOD(device_attach, uart_bus_attach), + DEVMETHOD(device_attach, snps_attach), DEVMETHOD(device_detach, snps_detach), DEVMETHOD_END };