From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH 4/8] Char: moxa, remove hangup bottomhalf
Date: Sun, 31 Dec 2006 02:04:50 +0100 (CET) [thread overview]
Message-ID: <2970917086546717235@wsc.cz> (raw)
In-Reply-To: <152402571305932932@wsc.cz>
moxa, remove hangup bottomhalf
call tty_hangup directly, we do not need a bottomhalf for this.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
commit 9146480faf6469f789229e4f09d99a90b3e05c26
tree 58eb5f2f3943a17ad05b3fd869ab987e63a4fe14
parent 8171e38961018ef16df52084d1356f891f43ba6f
author Jiri Slaby <jirislaby@gmail.com> Sun, 31 Dec 2006 01:42:55 +0059
committer Jiri Slaby <jirislaby@gmail.com> Sun, 31 Dec 2006 01:42:55 +0059
drivers/char/moxa.c | 25 +++----------------------
1 files changed, 3 insertions(+), 22 deletions(-)
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index 84797a0..ef2558f 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -159,7 +159,6 @@ struct moxa_str {
int cflag;
wait_queue_head_t open_wait;
wait_queue_head_t close_wait;
- struct work_struct tqueue;
};
struct mxser_mstatus {
@@ -178,9 +177,6 @@ static struct mxser_mstatus GMStatus[MAX_PORTS];
#define EMPTYWAIT 0x4
#define THROTTLE 0x8
-/* event */
-#define MOXA_EVENT_HANGUP 1
-
#define SERIAL_DO_RESTART
@@ -213,7 +209,6 @@ module_param(verbose, bool, 0644);
/*
* static functions:
*/
-static void do_moxa_softint(struct work_struct *);
static int moxa_open(struct tty_struct *, struct file *);
static void moxa_close(struct tty_struct *, struct file *);
static int moxa_write(struct tty_struct *, const unsigned char *, int);
@@ -354,7 +349,6 @@ static int __init moxa_init(void)
for (i = 0, ch = moxaChannels; i < MAX_PORTS; i++, ch++) {
ch->type = PORT_16550A;
ch->port = i;
- INIT_WORK(&ch->tqueue, do_moxa_softint);
ch->close_delay = 5 * HZ / 10;
ch->closing_wait = 30 * HZ;
ch->cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;
@@ -482,20 +476,6 @@ static void __exit moxa_exit(void)
module_init(moxa_init);
module_exit(moxa_exit);
-static void do_moxa_softint(struct work_struct *work)
-{
- struct moxa_str *ch = container_of(work, struct moxa_str, tqueue);
- struct tty_struct *tty;
-
- if (ch && (tty = ch->tty)) {
- if (test_and_clear_bit(MOXA_EVENT_HANGUP, &ch->event)) {
- tty_hangup(tty); /* FIXME: module removal race here - AKPM */
- wake_up_interruptible(&ch->open_wait);
- ch->asyncflags &= ~ASYNC_NORMAL_ACTIVE;
- }
- }
-}
-
static int moxa_open(struct tty_struct *tty, struct file *filp)
{
struct moxa_str *ch;
@@ -908,8 +888,9 @@ static void moxa_poll(unsigned long ignored)
if (MoxaPortDCDON(ch->port))
wake_up_interruptible(&ch->open_wait);
else {
- set_bit(MOXA_EVENT_HANGUP, &ch->event);
- schedule_work(&ch->tqueue);
+ tty_hangup(tp);
+ wake_up_interruptible(&ch->open_wait);
+ ch->asyncflags &= ~ASYNC_NORMAL_ACTIVE;
}
}
}
next prev parent reply other threads:[~2006-12-31 1:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-31 1:04 [PATCH 1/8] Char: moxa, remove unused allocated page Jiri Slaby
2006-12-31 1:04 ` [PATCH 2/8] Char: moxa, do not initialize global static Jiri Slaby
2006-12-31 1:04 ` [PATCH 3/8] Char: moxa, timers cleanup Jiri Slaby
2006-12-31 1:04 ` Jiri Slaby [this message]
2006-12-31 1:05 ` [PATCH 5/8] Char: moxa, remove unused functions Jiri Slaby
2006-12-31 1:05 ` [PATCH 6/8] Char: moxa, devids cleanup Jiri Slaby
2006-12-31 1:05 ` [PATCH 7/8] Char: moxa, use PCI_DEVICE Jiri Slaby
2006-12-31 1:05 ` [PATCH 8/8] Char: moxa, eliminate typedefs Jiri Slaby
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=2970917086546717235@wsc.cz \
--to=jirislaby@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/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