svn commit: r257195 - head/sys/dev/uart
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Sat Oct 26 20:06:51 UTC 2013
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.
*/
More information about the svn-src-head
mailing list