Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/fdt enumerate devices under child "clocks" node



details:   https://anonhg.NetBSD.org/src/rev/29885646c9d8
branches:  trunk
changeset: 1004438:29885646c9d8
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Oct 28 21:13:48 2019 +0000

description:
enumerate devices under child "clocks" node

diffstat:

 sys/dev/fdt/syscon.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r d0d414718d89 -r 29885646c9d8 sys/dev/fdt/syscon.c
--- a/sys/dev/fdt/syscon.c      Mon Oct 28 21:11:23 2019 +0000
+++ b/sys/dev/fdt/syscon.c      Mon Oct 28 21:13:48 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: syscon.c,v 1.3 2019/02/25 19:28:36 jmcneill Exp $ */
+/* $NetBSD: syscon.c,v 1.4 2019/10/28 21:13:48 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: syscon.c,v 1.3 2019/02/25 19:28:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscon.c,v 1.4 2019/10/28 21:13:48 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -113,6 +113,7 @@
        const int phandle = faa->faa_phandle;
        bus_addr_t addr;
        bus_size_t size;
+       int child;
 
        if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) {
                aprint_error(": couldn't get registers\n");
@@ -138,4 +139,8 @@
        fdtbus_register_syscon(self, phandle, &sc->sc_syscon);
 
        fdt_add_bus(self, phandle, faa);
+
+       child = of_find_firstchild_byname(phandle, "clocks");
+       if (child > 0)
+               fdt_add_bus(self, child, faa);
 }



Home | Main Index | Thread Index | Old Index