diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2011-01-09 16:39:14 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-01-22 19:15:00 -0800 |
commit | a2a6a822adc2a91c677cb60e9bc6ffe26fa90e9f (patch) | |
tree | b222b20d29711cd766db1c0b2537780dc885b138 /drivers/tty/tty_io.c | |
parent | c55c63c6539499379ab4a7e8a5c0f857351fb946 (diff) |
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>
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r-- | drivers/tty/tty_io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 464d09d9787..dae6fc96182 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -3257,7 +3257,7 @@ static ssize_t show_cons_active(struct device *dev, ssize_t count = 0; acquire_console_sem(); - for (c = console_drivers; c; c = c->next) { + for_each_console(c) { if (!c->device) continue; if (!c->write) @@ -3306,7 +3306,7 @@ int __init tty_init(void) if (IS_ERR(consdev)) consdev = NULL; else - device_create_file(consdev, &dev_attr_active); + WARN_ON(device_create_file(consdev, &dev_attr_active) < 0); #ifdef CONFIG_VT vty_init(&console_fops); |