Skip to content

Commit c83a206

Browse files
jognesspmladek
authored andcommitted
proc: Add nbcon support for /proc/consoles
Update /proc/consoles output to show 'W' if an nbcon console is registered. Since the write_thread() callback is mandatory, it enough just to check if it is an nbcon console. Also update /proc/consoles output to show 'N' if it is an nbcon console. Signed-off-by: John Ogness <john.ogness@linutronix.de> Reviewed-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20240904120536.115780-14-john.ogness@linutronix.de Signed-off-by: Petr Mladek <pmladek@suse.com>
1 parent fe6fa88 commit c83a206

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/proc/consoles.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ static int show_console_dev(struct seq_file *m, void *v)
2121
{ CON_ENABLED, 'E' },
2222
{ CON_CONSDEV, 'C' },
2323
{ CON_BOOT, 'B' },
24+
{ CON_NBCON, 'N' },
2425
{ CON_PRINTBUFFER, 'p' },
2526
{ CON_BRL, 'b' },
2627
{ CON_ANYTIME, 'a' },
@@ -58,8 +59,8 @@ static int show_console_dev(struct seq_file *m, void *v)
5859
seq_printf(m, "%s%d", con->name, con->index);
5960
seq_pad(m, ' ');
6061
seq_printf(m, "%c%c%c (%s)", con->read ? 'R' : '-',
61-
con->write ? 'W' : '-', con->unblank ? 'U' : '-',
62-
flags);
62+
((con->flags & CON_NBCON) || con->write) ? 'W' : '-',
63+
con->unblank ? 'U' : '-', flags);
6364
if (dev)
6465
seq_printf(m, " %4d:%d", MAJOR(dev), MINOR(dev));
6566

0 commit comments

Comments
 (0)