Module Name: src Committed By: jmcneill Date: Fri Jun 30 09:11:22 UTC 2017
Modified Files: src/sys/dev/fdt: fdt_subr.c fdtvar.h Log Message: Add fdtbus_get_string helper To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/dev/fdt/fdt_subr.c cvs rdiff -u -r1.21 -r1.22 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_subr.c diff -u src/sys/dev/fdt/fdt_subr.c:1.13 src/sys/dev/fdt/fdt_subr.c:1.14 --- src/sys/dev/fdt/fdt_subr.c:1.13 Fri Jun 2 01:07:53 2017 +++ src/sys/dev/fdt/fdt_subr.c Fri Jun 30 09:11:22 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: fdt_subr.c,v 1.13 2017/06/02 01:07:53 jmcneill Exp $ */ +/* $NetBSD: fdt_subr.c,v 1.14 2017/06/30 09:11:22 jmcneill Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill <jmcne...@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.13 2017/06/02 01:07:53 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.14 2017/06/30 09:11:22 jmcneill Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -406,3 +406,11 @@ fdtbus_status_okay(int phandle) return strncmp(prop, "ok", 2) == 0; } + +const char * +fdtbus_get_string(int phandle, const char *prop) +{ + const int off = fdtbus_phandle2offset(phandle); + + return fdt_getprop(fdtbus_get_data(), off, prop, NULL); +} Index: src/sys/dev/fdt/fdtvar.h diff -u src/sys/dev/fdt/fdtvar.h:1.21 src/sys/dev/fdt/fdtvar.h:1.22 --- src/sys/dev/fdt/fdtvar.h:1.21 Thu Jun 29 17:04:17 2017 +++ src/sys/dev/fdt/fdtvar.h Fri Jun 30 09:11:22 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: fdtvar.h,v 1.21 2017/06/29 17:04:17 jmcneill Exp $ */ +/* $NetBSD: fdtvar.h,v 1.22 2017/06/30 09:11:22 jmcneill Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill <jmcne...@invisible.ca> @@ -294,6 +294,8 @@ tcflag_t fdtbus_get_stdout_flags(void); bool fdtbus_status_okay(int); +const char * fdtbus_get_string(int, const char *); + int fdtbus_print(void *, const char *); #endif /* _DEV_FDT_FDTVAR_H */