Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/fdt If the stdout-path property is missing on /chose...



details:   https://anonhg.NetBSD.org/src/rev/bf702f294426
branches:  trunk
changeset: 823473:bf702f294426
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Apr 24 10:56:03 2017 +0000

description:
If the stdout-path property is missing on /chosen, assume serial0:115200n8

diffstat:

 sys/dev/fdt/fdt_subr.c |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 36a7440f8690 -r bf702f294426 sys/dev/fdt/fdt_subr.c
--- a/sys/dev/fdt/fdt_subr.c    Mon Apr 24 10:55:26 2017 +0000
+++ b/sys/dev/fdt/fdt_subr.c    Mon Apr 24 10:56:03 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_subr.c,v 1.8 2017/04/21 23:35:01 jmcneill Exp $ */
+/* $NetBSD: fdt_subr.c,v 1.9 2017/04/24 10:56:03 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.8 2017/04/21 23:35:01 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.9 2017/04/24 10:56:03 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -220,11 +220,18 @@
 const char *
 fdtbus_get_stdout_path(void)
 {
+       const char *prop;
+
        const int off = fdt_path_offset(fdtbus_get_data(), "/chosen");
        if (off < 0)
                return NULL;
-       
-       return fdt_getprop(fdtbus_get_data(), off, "stdout-path", NULL);
+
+       prop = fdt_getprop(fdtbus_get_data(), off, "stdout-path", NULL);
+       if (prop != NULL)
+               return prop;
+
+       /* If the stdout-path property is not found, assume serial0 */
+       return "serial0:115200n8";
 }
 
 int



Home | Main Index | Thread Index | Old Index