From: Richard Weinberger <richard@nod.at>
To: jslaby@suse.cz
Cc: user-mode-linux-devel@lists.sourceforge.net,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
viro@zeniv.linux.org.uk, alan@linux.intel.com,
Jeff Dike <jdike@addtoit.com>,
Richard Weinberger <richard@nod.at>
Subject: [PATCH 1/6] TTY: um/line, add tty_port
Date: Mon, 4 Jun 2012 22:27:32 +0200 [thread overview]
Message-ID: <1338841657-30358-2-git-send-email-richard@nod.at> (raw)
In-Reply-To: <1338841657-30358-1-git-send-email-richard@nod.at>
From: Jiri Slaby <jslaby@suse.cz>
And use count from there.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: user-mode-linux-devel@lists.sourceforge.net
Signed-off-by: Richard Weinberger <richard@nod.at>
---
arch/um/drivers/line.c | 7 ++++---
arch/um/drivers/line.h | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index acfd0e0..482a7bd 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -404,7 +404,7 @@ int line_open(struct line *lines, struct tty_struct *tty)
goto out_unlock;
err = 0;
- if (line->count++)
+ if (line->port.count++)
goto out_unlock;
BUG_ON(tty->driver_data);
@@ -446,7 +446,7 @@ void line_close(struct tty_struct *tty, struct file * filp)
mutex_lock(&line->count_lock);
BUG_ON(!line->valid);
- if (--line->count)
+ if (--line->port.count)
goto out_unlock;
line->tty = NULL;
@@ -478,7 +478,7 @@ int setup_one_line(struct line *lines, int n, char *init,
mutex_lock(&line->count_lock);
- if (line->count) {
+ if (line->port.count) {
*error_out = "Device is already open";
goto out;
}
@@ -663,6 +663,7 @@ int register_lines(struct line_driver *line_driver,
driver->init_termios = tty_std_termios;
for (i = 0; i < nlines; i++) {
+ tty_port_init(&lines[i].port);
spin_lock_init(&lines[i].lock);
mutex_init(&lines[i].count_lock);
lines[i].driver = line_driver;
diff --git a/arch/um/drivers/line.h b/arch/um/drivers/line.h
index 0a18347..0e06a1f 100644
--- a/arch/um/drivers/line.h
+++ b/arch/um/drivers/line.h
@@ -32,9 +32,9 @@ struct line_driver {
};
struct line {
+ struct tty_port port;
struct tty_struct *tty;
struct mutex count_lock;
- unsigned long count;
int valid;
char *init_str;
--
1.7.7.3
next prev parent reply other threads:[~2012-06-04 20:27 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-04 20:27 um: TTY fixes (?) Richard Weinberger
2012-06-04 20:27 ` Richard Weinberger [this message]
2012-06-04 20:27 ` [PATCH 2/6] TTY: um/line, use tty from tty_port Richard Weinberger
2012-06-04 20:27 ` [PATCH 3/6] um: remove line_ioctl() Richard Weinberger
2012-06-04 20:27 ` [PATCH 4/6] um: Remove dead code Richard Weinberger
2012-06-04 20:27 ` [PATCH 5/6] um: fully use tty_port Richard Weinberger
2012-06-04 20:47 ` Jiri Slaby
2012-06-04 20:27 ` [PATCH 6/6] um: remove count_lock Richard Weinberger
2012-06-04 21:17 ` um: TTY fixes (?) Alan Cox
2012-06-04 23:14 ` Richard Weinberger
2012-06-05 10:41 ` Karel Zak
2012-06-05 11:15 ` Alan Cox
2012-06-05 12:20 ` Richard Weinberger
2012-06-05 15:17 ` Karel Zak
2012-07-12 14:49 ` Karel Zak
2012-07-12 15:01 ` Richard Weinberger
2012-06-06 23:17 ` Richard Weinberger
2012-06-07 9:19 ` Alan Cox
2012-06-07 9:06 ` Richard Weinberger
2012-06-06 14:20 ` [uml-devel] " Boaz Harrosh
2012-06-07 7:35 ` Boaz Harrosh
2012-06-07 7:43 ` Boaz Harrosh
2012-06-07 8:45 ` Richard Weinberger
2012-06-07 9:22 ` Alan Cox
2012-06-07 10:14 ` Boaz Harrosh
2012-06-07 10:19 ` Richard Weinberger
2012-06-07 10:35 ` Boaz Harrosh
2012-06-07 10:52 ` Alan Cox
2012-06-07 13:41 ` Boaz Harrosh
2012-06-07 15:18 ` Richard Weinberger
2012-06-07 16:37 ` Alan Cox
2012-06-07 16:32 ` Richard Weinberger
2012-06-07 16:50 ` Alan Cox
2012-06-07 16:41 ` Richard Weinberger
2012-06-07 17:26 ` Alan Cox
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=1338841657-30358-2-git-send-email-richard@nod.at \
--to=richard@nod.at \
--cc=alan@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jdike@addtoit.com \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
--cc=viro@zeniv.linux.org.uk \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®