diff options
author | marcel <marcel@FreeBSD.org> | 2011-01-29 21:08:03 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2011-01-29 21:08:03 +0000 |
commit | 9ac3b7b64ac61834316c2216fb8fd1459d0f04fc (patch) | |
tree | 4f984acd89b6b047fd7a950021a993ea94c2e0f3 /sys/dev/fdt | |
parent | d129fb0e44db1f4eba2f03627ac099e40f08122d (diff) | |
download | FreeBSD-src-9ac3b7b64ac61834316c2216fb8fd1459d0f04fc.zip FreeBSD-src-9ac3b7b64ac61834316c2216fb8fd1459d0f04fc.tar.gz |
Call newbus_device_create() for PCI devices. Call pci_from_fdt_node()
for the newly created device_t, rather than the parent.
Diffstat (limited to 'sys/dev/fdt')
-rw-r--r-- | sys/dev/fdt/fdtbus.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/fdt/fdtbus.c b/sys/dev/fdt/fdtbus.c index 610f213..96d9a6e 100644 --- a/sys/dev/fdt/fdtbus.c +++ b/sys/dev/fdt/fdtbus.c @@ -39,10 +39,10 @@ __FBSDID("$FreeBSD$"); #include <sys/rman.h> #include <sys/malloc.h> -#include <dev/ofw/openfirm.h> - #include <machine/fdt.h> +#include <dev/ofw/openfirm.h> + #include "fdt_common.h" #include "ofw_bus_if.h" @@ -150,6 +150,8 @@ static void fdtbus_identify(driver_t *driver, device_t parent) { + debugf("%s(driver=%p, parent=%p)\n", __func__, driver, parent); + if (device_find_child(parent, "fdtbus", -1) == NULL) BUS_ADD_CHILD(parent, 0, "fdtbus", -1); } @@ -158,6 +160,8 @@ static int fdtbus_probe(device_t dev) { + debugf("%s(dev=%p); pass=%u\n", __func__, dev, bus_current_pass); + device_set_desc(dev, "FDT main bus"); if (!bootverbose) device_quiet(dev); @@ -472,12 +476,9 @@ newbus_device_from_fdt_node(device_t dev_par, phandle_t node) return; } - if (type != NULL && strcmp(type, "pci") == 0) { - pci_from_fdt_node(dev_par, node, name, type, compat); - return; - } - child = newbus_device_create(dev_par, node, name, type, compat); + if (type != NULL && strcmp(type, "pci") == 0) + pci_from_fdt_node(child, node, name, type, compat); } static struct resource * |