char line[256], *tty, *split;
int i;
+ /* First, try console= on the kernel command line,
+ * then fallback to /sys/class/tty/console/active,
+ * which should work when linux,stdout-path (or equivalent)
+ * is in the device tree
+ */
tty = get_cmdline_val("console", line, sizeof(line));
+ if (tty == NULL) {
+ if (dev_exist("console"))
+ tty = "console";
+ else
+ tty = get_active_console(line, sizeof(line));
+ }
if (tty != NULL) {
split = strchr(tty, ',');
if (split != NULL)
list_for_each_entry(a, &actions, list)
if (!strcmp(a->handler->name, handler)) {
- if (a->handler->multi) {
- a->handler->cb(a);
- continue;
- }
a->handler->cb(a);
- break;
+ if (!a->handler->multi)
+ break;
}
}