Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64/dev Don't try to make a tag based on node 0



details:   https://anonhg.NetBSD.org/src/rev/0f8d4057b02f
branches:  trunk
changeset: 371236:0f8d4057b02f
user:      charlotte <charlotte%NetBSD.org@localhost>
date:      Sat Oct 01 07:59:25 2022 +0000

description:
Don't try to make a tag based on node 0

diffstat:

 sys/arch/sparc64/dev/pci_machdep.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r 204bc474e198 -r 0f8d4057b02f sys/arch/sparc64/dev/pci_machdep.c
--- a/sys/arch/sparc64/dev/pci_machdep.c        Sat Oct 01 07:22:55 2022 +0000
+++ b/sys/arch/sparc64/dev/pci_machdep.c        Sat Oct 01 07:59:25 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.78 2018/09/03 16:29:27 riastradh Exp $       */
+/*     $NetBSD: pci_machdep.c,v 1.79 2022/10/01 07:59:25 charlotte Exp $       */
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.78 2018/09/03 16:29:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.79 2022/10/01 07:59:25 charlotte Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -116,7 +116,7 @@
        struct ofw_pci_register reg;
        pcitag_t tag;
        int (*valid)(void *);
-       int node, len;
+       int node, new_node, len;
 #ifdef DEBUG
        char name[80];
        memset(name, 0, sizeof(name));
@@ -193,8 +193,11 @@
                                break;
                        if (len != 2 || b < busrange[0] || b > busrange[1])
                                break;
-                       /* Go down 1 level */
-                       node = prom_firstchild(node);
+                       /* Go down 1 level, as long as we're able */
+                       new_node = prom_firstchild(node);
+                       if (new_node == 0)
+                               break;
+                       node = new_node;
                        DPRINTF(SPDB_PROBE, ("going down to node %x %s\n", node,
                            prom_getpropstringA(node, "name", name,
                                sizeof(name))));



Home | Main Index | Thread Index | Old Index