Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/fdt Add fdtbus_clock_count to count the number of cl...



details:   https://anonhg.NetBSD.org/src/rev/3e5ac449add4
branches:  trunk
changeset: 966405:3e5ac449add4
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Oct 28 21:15:34 2019 +0000

description:
Add fdtbus_clock_count to count the number of clock references on a given node

diffstat:

 sys/dev/fdt/fdt_clock.c |  12 ++++++------
 sys/dev/fdt/fdtvar.h    |   3 ++-
 2 files changed, 8 insertions(+), 7 deletions(-)

diffs (57 lines):

diff -r 5bf014d665fa -r 3e5ac449add4 sys/dev/fdt/fdt_clock.c
--- a/sys/dev/fdt/fdt_clock.c   Mon Oct 28 21:14:58 2019 +0000
+++ b/sys/dev/fdt/fdt_clock.c   Mon Oct 28 21:15:34 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_clock.c,v 1.8 2019/02/27 16:56:00 jakllsch Exp $ */
+/* $NetBSD: fdt_clock.c,v 1.9 2019/10/28 21:15:34 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_clock.c,v 1.8 2019/02/27 16:56:00 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_clock.c,v 1.9 2019/10/28 21:15:34 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -133,8 +133,8 @@
        return fdtbus_clock_get_index(phandle, index);
 }
 
-static u_int
-fdtbus_clock_count_prop(int phandle, const char *prop)
+u_int
+fdtbus_clock_count(int phandle, const char *prop)
 {
        u_int n, clock_cells;
        int len, resid;
@@ -207,8 +207,8 @@
        if (rates == NULL)
                rates_len = 0;
 
-       const u_int nclocks = fdtbus_clock_count_prop(phandle, "assigned-clocks");
-       const u_int nparents = fdtbus_clock_count_prop(phandle, "assigned-clock-parents");
+       const u_int nclocks = fdtbus_clock_count(phandle, "assigned-clocks");
+       const u_int nparents = fdtbus_clock_count(phandle, "assigned-clock-parents");
        const u_int nrates = rates_len / sizeof(*rates);
 
        for (index = 0; index < nclocks; index++) {
diff -r 5bf014d665fa -r 3e5ac449add4 sys/dev/fdt/fdtvar.h
--- a/sys/dev/fdt/fdtvar.h      Mon Oct 28 21:14:58 2019 +0000
+++ b/sys/dev/fdt/fdtvar.h      Mon Oct 28 21:15:34 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtvar.h,v 1.55 2019/10/28 21:14:58 jmcneill Exp $ */
+/* $NetBSD: fdtvar.h,v 1.56 2019/10/28 21:15:34 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -366,6 +366,7 @@
 struct clk *   fdtbus_clock_get_index(int, u_int);
 struct clk *   fdtbus_clock_byname(const char *);
 void           fdtbus_clock_assign(int);
+u_int          fdtbus_clock_count(int, const char *);
 
 struct fdtbus_reset *fdtbus_reset_get(int, const char *);
 struct fdtbus_reset *fdtbus_reset_get_index(int, u_int);



Home | Main Index | Thread Index | Old Index