LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Kay Sievers <kay.sievers@vrfy.org>, Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 2/5] tty: use for_each_console() and WARN() on sysfs failures
Date: Mon, 31 Jan 2011 08:31:07 -0800	[thread overview]
Message-ID: <1296491470-23096-2-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <20110131162852.GA22875@kroah.com>

From: Kay Sievers <kay.sievers@vrfy.org>

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>
---
 drivers/tty/tty_io.c |    4 ++--
 drivers/tty/vt/vt.c  |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 464d09d..dae6fc9 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);
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 4f6ae05..9550618 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -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();
 
-- 
1.7.1


  parent reply	other threads:[~2011-01-31 16:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-31 16:28 [GIT PATCH] TTY/serial driver fixes for .38 Greg KH
2011-01-31 16:31 ` [PATCH 1/5] vt: fix issue when fbcon wants to takeover a second time Greg Kroah-Hartman
2011-01-31 16:31 ` Greg Kroah-Hartman [this message]
2011-01-31 16:31 ` [PATCH 3/5] serial: unbreak billionton CF card Greg Kroah-Hartman
2011-01-31 21:48   ` Alan Cox
2011-02-11 14:27     ` Pavel Machek
2011-01-31 16:31 ` [PATCH 4/5] n_hdlc: fix read and write locking Greg Kroah-Hartman
2011-01-31 16:31 ` [PATCH 5/5] tty/serial: fix apbuart build Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296491470-23096-2-git-send-email-gregkh@suse.de \
    --to=gregkh@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 2/5] tty: use for_each_console() and WARN() on sysfs failures' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).