1
0
Fork 0

tty: use for_each_console() and WARN() on sysfs failures

This fixes the build warnings in the tty code, and uses the proper
function for iterating over the console devices.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
hifive-unleashed-5.1
Kay Sievers 2011-01-09 16:39:14 +01:00 committed by Greg Kroah-Hartman
parent c55c63c653
commit a2a6a822ad
2 changed files with 3 additions and 3 deletions

View File

@ -3257,7 +3257,7 @@ static ssize_t show_cons_active(struct device *dev,
ssize_t count = 0; ssize_t count = 0;
acquire_console_sem(); acquire_console_sem();
for (c = console_drivers; c; c = c->next) { for_each_console(c) {
if (!c->device) if (!c->device)
continue; continue;
if (!c->write) if (!c->write)
@ -3306,7 +3306,7 @@ int __init tty_init(void)
if (IS_ERR(consdev)) if (IS_ERR(consdev))
consdev = NULL; consdev = NULL;
else else
device_create_file(consdev, &dev_attr_active); WARN_ON(device_create_file(consdev, &dev_attr_active) < 0);
#ifdef CONFIG_VT #ifdef CONFIG_VT
vty_init(&console_fops); vty_init(&console_fops);

View File

@ -2994,7 +2994,7 @@ int __init vty_init(const struct file_operations *console_fops)
if (IS_ERR(tty0dev)) if (IS_ERR(tty0dev))
tty0dev = NULL; tty0dev = NULL;
else else
device_create_file(tty0dev, &dev_attr_active); WARN_ON(device_create_file(tty0dev, &dev_attr_active) < 0);
vcs_init(); vcs_init();