Module Name: src
Committed By: jmcneill
Date: Sat Jun 16 00:13:06 UTC 2018
Modified Files:
src/sys/dev/fdt: fixedclock.c
Log Message:
If clock-output-names is specified, use it for the clock name instead of the
node name
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/fdt/fixedclock.c
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/fixedclock.c
diff -u src/sys/dev/fdt/fixedclock.c:1.3 src/sys/dev/fdt/fixedclock.c:1.4
--- src/sys/dev/fdt/fixedclock.c:1.3 Sat Apr 28 15:21:05 2018
+++ src/sys/dev/fdt/fixedclock.c Sat Jun 16 00:13:06 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fixedclock.c,v 1.3 2018/04/28 15:21:05 jmcneill Exp $ */
+/* $NetBSD: fixedclock.c,v 1.4 2018/06/16 00:13:06 jmcneill Exp $ */
/*-
* Copyright (c) 2017 Jared D. McNeill <[email protected]>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fixedclock.c,v 1.3 2018/04/28 15:21:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fixedclock.c,v 1.4 2018/06/16 00:13:06 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -89,6 +89,11 @@ fixedclock_attach(device_t parent, devic
struct fixedclock_softc * const sc = device_private(self);
const struct fdt_attach_args *faa = aux;
const int phandle = faa->faa_phandle;
+ const char *clkname;
+
+ clkname = fdtbus_get_string(phandle, "clock-output-names");
+ if (!clkname)
+ clkname = faa->faa_name;
sc->sc_dev = self;
sc->sc_phandle = phandle;
@@ -101,11 +106,11 @@ fixedclock_attach(device_t parent, devic
return;
}
sc->sc_clk.base.domain = &sc->sc_clkdom;
- sc->sc_clk.base.name = kmem_asprintf("%s", faa->faa_name);
+ sc->sc_clk.base.name = kmem_asprintf("%s", clkname);
clk_attach(&sc->sc_clk.base);
aprint_naive("\n");
- aprint_normal(": %u Hz fixed clock\n", sc->sc_clk.rate);
+ aprint_normal(": %u Hz fixed clock (%s)\n", sc->sc_clk.rate, clkname);
fdtbus_register_clock_controller(self, phandle, &fixedclock_fdt_funcs);
}