Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2a6a822 authored by Kay Sievers's avatar Kay Sievers Committed by Greg Kroah-Hartman
Browse files

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: default avatarKay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c55c63c6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -2994,7 +2994,7 @@ int __init vty_init(const struct file_operations *console_fops)
	if (IS_ERR(tty0dev))
		tty0dev = NULL;
	else
		device_create_file(tty0dev, &dev_attr_active);
		WARN_ON(device_create_file(tty0dev, &dev_attr_active) < 0);

	vcs_init();