Try even harder to find a console before giving up.

This commit is contained in:
Nathan Whitehorn 2013-10-26 20:06:50 +00:00
parent c2788c07bf
commit 94f33b0ab6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=257195

View File

@ -139,14 +139,19 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
/*
* 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.
*/