Module Name: src Committed By: jmcneill Date: Mon Apr 24 10:56:03 UTC 2017
Modified Files: src/sys/dev/fdt: fdt_subr.c Log Message: If the stdout-path property is missing on /chosen, assume serial0:115200n8 To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 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.8 src/sys/dev/fdt/fdt_subr.c:1.9 --- src/sys/dev/fdt/fdt_subr.c:1.8 Fri Apr 21 23:35:01 2017 +++ src/sys/dev/fdt/fdt_subr.c Mon Apr 24 10:56:03 2017 @@ -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 <jmcne...@invisible.ca> @@ -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 @@ fdtbus_get_reg(int phandle, u_int index, 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