Author: andrew
Date: Tue Feb  2 16:32:44 2016
New Revision: 295153
URL: https://svnweb.freebsd.org/changeset/base/295153

Log:
  Only look for the ranges property when we have children. This fixes booting
  on systems with a gicv2, but no PCIe so no gicv2m.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm64/arm64/gic_fdt.c

Modified: head/sys/arm64/arm64/gic_fdt.c
==============================================================================
--- head/sys/arm64/arm64/gic_fdt.c      Tue Feb  2 16:25:53 2016        
(r295152)
+++ head/sys/arm64/arm64/gic_fdt.c      Tue Feb  2 16:32:44 2016        
(r295153)
@@ -158,12 +158,17 @@ arm_gic_fdt_attach(device_t dev)
        OF_getencprop(root, "#size-cells", &sc->sc_size_cells,
            sizeof(sc->sc_size_cells));
 
+       /* If we have no children don't probe for them */
+       child = OF_child(root);
+       if (child == 0)
+               return (0);
+
        if (gic_fill_ranges(root, sc) < 0) {
                device_printf(dev, "could not get ranges\n");
                return (ENXIO);
        }
 
-       for (child = OF_child(root); child != 0; child = OF_peer(child)) {
+       for (; child != 0; child = OF_peer(child)) {
                dinfo = malloc(sizeof(*dinfo), M_DEVBUF, M_WAITOK | M_ZERO);
 
                if (ofw_bus_gen_setup_devinfo(&dinfo->obdinfo, child) != 0) {
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to