Call newbus_device_create() for PCI devices. Call pci_from_fdt_node()

for the newly created device_t, rather than the parent.
This commit is contained in:
Marcel Moolenaar 2011-01-29 21:08:03 +00:00
parent 6d2d7b8c0d
commit ac3fe75f97

View File

@ -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 *