Date: Sat, 26 Oct 2013 20:06:51 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257195 - head/sys/dev/uart Message-ID: <201310262006.r9QK6pgg017981@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Sat Oct 26 20:06:50 2013 New Revision: 257195 URL: http://svnweb.freebsd.org/changeset/base/257195 Log: Try even harder to find a console before giving up. Modified: head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Sat Oct 26 20:01:00 2013 (r257194) +++ head/sys/dev/uart/uart_cpu_fdt.c Sat Oct 26 20:06:50 2013 (r257195) @@ -139,14 +139,19 @@ uart_cpu_getdev(int devtype, struct uart /* * Retrieve /chosen/std{in,out}. */ - if ((chosen = OF_finddevice("/chosen")) == -1) - return (ENXIO); - for (name = propnames; *name != NULL; name++) { - if (phandle_chosen_propdev(chosen, *name, &node) == 0) - break; + node = -1; + if ((chosen = OF_finddevice("/chosen")) != -1) { + for (name = propnames; *name != NULL; name++) { + if (phandle_chosen_propdev(chosen, *name, &node) == 0) + break; + } } - if (*name == NULL) + if (chosen == -1 || *name == NULL) + node = OF_finddevice("serial0"); /* Last ditch */ + + if (node == -1) /* Can't find anything */ return (ENXIO); + /* * Retrieve serial attributes. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310262006.r9QK6pgg017981>