tty: sysfs: Add nbcon support for 'active'

BugLink: https://bugs.launchpad.net/bugs/2060704

Allow the 'active' attribute to list nbcon consoles.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Kevin Becker <kevin.becker@canonical.com>
This commit is contained in:
John Ogness
2023-09-22 14:31:09 +00:00
committed by Kevin Becker
parent 03b98ce8da
commit 7cdfa7fb25
+7 -2
View File
@@ -3567,8 +3567,13 @@ static ssize_t show_cons_active(struct device *dev,
for_each_console(c) {
if (!c->device)
continue;
if (!c->write)
continue;
if (c->flags & CON_NBCON) {
if (!c->write_atomic && !c->write_thread)
continue;
} else {
if (!c->write)
continue;
}
if ((c->flags & CON_ENABLED) == 0)
continue;
cs[i++] = c;