Author: marcel
Date: Sat Jan 29 21:08:03 2011
New Revision: 218076
URL: http://svn.freebsd.org/changeset/base/218076

Log:
  Call newbus_device_create() for PCI devices. Call pci_from_fdt_node()
  for the newly created device_t, rather than the parent.

Modified:
  head/sys/dev/fdt/fdtbus.c

Modified: head/sys/dev/fdt/fdtbus.c
==============================================================================
--- head/sys/dev/fdt/fdtbus.c   Sat Jan 29 20:58:38 2011        (r218075)
+++ head/sys/dev/fdt/fdtbus.c   Sat Jan 29 21:08:03 2011        (r218076)
@@ -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
                        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 *
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to