Module Name: src
Committed By: jmcneill
Date: Mon Oct 28 21:15:34 UTC 2019
Modified Files:
src/sys/dev/fdt: fdt_clock.c fdtvar.h
Log Message:
Add fdtbus_clock_count to count the number of clock references on a given node
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/fdt/fdt_clock.c
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/fdt/fdtvar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/fdt/fdt_clock.c
diff -u src/sys/dev/fdt/fdt_clock.c:1.8 src/sys/dev/fdt/fdt_clock.c:1.9
--- src/sys/dev/fdt/fdt_clock.c:1.8 Wed Feb 27 16:56:00 2019
+++ src/sys/dev/fdt/fdt_clock.c Mon Oct 28 21:15:34 2019
@@ -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 <[email protected]>
@@ -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 @@ fdtbus_clock_get_prop(int phandle, const
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 @@ fdtbus_clock_assign(int phandle)
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++) {
Index: src/sys/dev/fdt/fdtvar.h
diff -u src/sys/dev/fdt/fdtvar.h:1.55 src/sys/dev/fdt/fdtvar.h:1.56
--- src/sys/dev/fdt/fdtvar.h:1.55 Mon Oct 28 21:14:58 2019
+++ src/sys/dev/fdt/fdtvar.h Mon Oct 28 21:15:34 2019
@@ -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 <[email protected]>
@@ -366,6 +366,7 @@ struct clk * fdtbus_clock_get(int, const
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);