summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/adb/adb_kbd.c2
-rw-r--r--sys/dev/uart/uart_cpu_fdt.c17
2 files changed, 12 insertions, 7 deletions
diff --git a/sys/dev/adb/adb_kbd.c b/sys/dev/adb/adb_kbd.c
index 6fca5ff..76d4e88 100644
--- a/sys/dev/adb/adb_kbd.c
+++ b/sys/dev/adb/adb_kbd.c
@@ -621,7 +621,7 @@ akbd_read_char(keyboard_t *kbd, int wait)
if (!sc->buffers) {
mtx_unlock(&sc->sc_mutex);
- return (0);
+ return (NOKEY);
}
adb_code = sc->buffer[0];
diff --git a/sys/dev/uart/uart_cpu_fdt.c b/sys/dev/uart/uart_cpu_fdt.c
index b063cb4..9bf3549 100644
--- a/sys/dev/uart/uart_cpu_fdt.c
+++ b/sys/dev/uart/uart_cpu_fdt.c
@@ -142,14 +142,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.
*/
OpenPOWER on IntegriCloud