Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/fdt fdtbus_get_string: support special 'name' property



details:   https://anonhg.NetBSD.org/src/rev/d53373df167e
branches:  trunk
changeset: 826648:d53373df167e
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Sep 19 22:55:49 2017 +0000

description:
fdtbus_get_string: support special 'name' property

diffstat:

 sys/dev/fdt/fdt_subr.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 43992821094c -r d53373df167e sys/dev/fdt/fdt_subr.c
--- a/sys/dev/fdt/fdt_subr.c    Tue Sep 19 21:45:28 2017 +0000
+++ b/sys/dev/fdt/fdt_subr.c    Tue Sep 19 22:55:49 2017 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
 {
        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 *



Home | Main Index | Thread Index | Old Index