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.
         */
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to