Module Name: src Committed By: jmcneill Date: Tue Sep 19 22:55:49 UTC 2017
Modified Files: src/sys/dev/fdt: fdt_subr.c Log Message: fdtbus_get_string: support special 'name' property To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/dev/fdt/fdt_subr.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/fdt_subr.c diff -u src/sys/dev/fdt/fdt_subr.c:1.18 src/sys/dev/fdt/fdt_subr.c:1.19 --- src/sys/dev/fdt/fdt_subr.c:1.18 Fri Aug 25 12:28:10 2017 +++ src/sys/dev/fdt/fdt_subr.c Tue Sep 19 22:55:49 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: fdt_subr.c,v 1.18 2017/08/25 12:28:10 jmcneill Exp $ */ +/* $NetBSD: fdt_subr.c,v 1.19 2017/09/19 22:55:49 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.18 2017/08/25 12:28:10 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.19 2017/09/19 22:55:49 jmcneill Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -438,7 +438,10 @@ fdtbus_get_string(int phandle, const cha { const int off = fdtbus_phandle2offset(phandle); - return fdt_getprop(fdtbus_get_data(), off, prop, NULL); + if (strcmp(prop, "name") == 0) + return fdt_get_name(fdtbus_get_data(), off, NULL); + else + return fdt_getprop(fdtbus_get_data(), off, prop, NULL); } const char *