diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-02-10 04:45:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 13:51:30 -0500 |
commit | ba196df3d6432c5c20429e8e447c5db7abedb8f3 (patch) | |
tree | a5e51a205ee1c7a8f6feb21de329640002fe4505 /drivers/char/moxa.c | |
parent | aa7e5221fb47badbea618cc62704d6e4a4bcce15 (diff) |
[PATCH] Char: moxa, remove hangup bottomhalf
Call tty_hangup directly, we do not need a bottomhalf for this.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/moxa.c')
-rw-r--r-- | 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 84797a090a97..ef2558f5a3fc 100644 --- a/drivers/char/moxa.c +++ b/drivers/char/moxa.c | |||
@@ -159,7 +159,6 @@ struct moxa_str { | |||
159 | int cflag; | 159 | int cflag; |
160 | wait_queue_head_t open_wait; | 160 | wait_queue_head_t open_wait; |
161 | wait_queue_head_t close_wait; | 161 | wait_queue_head_t close_wait; |
162 | struct work_struct tqueue; | ||
163 | }; | 162 | }; |
164 | 163 | ||
165 | struct mxser_mstatus { | 164 | struct mxser_mstatus { |
@@ -178,9 +177,6 @@ static struct mxser_mstatus GMStatus[MAX_PORTS]; | |||
178 | #define EMPTYWAIT 0x4 | 177 | #define EMPTYWAIT 0x4 |
179 | #define THROTTLE 0x8 | 178 | #define THROTTLE 0x8 |
180 | 179 | ||
181 | /* event */ | ||
182 | #define MOXA_EVENT_HANGUP 1 | ||
183 | |||
184 | #define SERIAL_DO_RESTART | 180 | #define SERIAL_DO_RESTART |
185 | 181 | ||
186 | 182 | ||
@@ -213,7 +209,6 @@ module_param(verbose, bool, 0644); | |||
213 | /* | 209 | /* |
214 | * static functions: | 210 | * static functions: |
215 | */ | 211 | */ |
216 | static void do_moxa_softint(struct work_struct *); | ||
217 | static int moxa_open(struct tty_struct *, struct file *); | 212 | static int moxa_open(struct tty_struct *, struct file *); |
218 | static void moxa_close(struct tty_struct *, struct file *); | 213 | static void moxa_close(struct tty_struct *, struct file *); |
219 | static int moxa_write(struct tty_struct *, const unsigned char *, int); | 214 | static int moxa_write(struct tty_struct *, const unsigned char *, int); |
@@ -354,7 +349,6 @@ static int __init moxa_init(void) | |||
354 | for (i = 0, ch = moxaChannels; i < MAX_PORTS; i++, ch++) { | 349 | for (i = 0, ch = moxaChannels; i < MAX_PORTS; i++, ch++) { |
355 | ch->type = PORT_16550A; | 350 | ch->type = PORT_16550A; |
356 | ch->port = i; | 351 | ch->port = i; |
357 | INIT_WORK(&ch->tqueue, do_moxa_softint); | ||
358 | ch->close_delay = 5 * HZ / 10; | 352 | ch->close_delay = 5 * HZ / 10; |
359 | ch->closing_wait = 30 * HZ; | 353 | ch->closing_wait = 30 * HZ; |
360 | ch->cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL; | 354 | ch->cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL; |
@@ -482,20 +476,6 @@ static void __exit moxa_exit(void) | |||
482 | module_init(moxa_init); | 476 | module_init(moxa_init); |
483 | module_exit(moxa_exit); | 477 | module_exit(moxa_exit); |
484 | 478 | ||
485 | static void do_moxa_softint(struct work_struct *work) | ||
486 | { | ||
487 | struct moxa_str *ch = container_of(work, struct moxa_str, tqueue); | ||
488 | struct tty_struct *tty; | ||
489 | |||
490 | if (ch && (tty = ch->tty)) { | ||
491 | if (test_and_clear_bit(MOXA_EVENT_HANGUP, &ch->event)) { | ||
492 | tty_hangup(tty); /* FIXME: module removal race here - AKPM */ | ||
493 | wake_up_interruptible(&ch->open_wait); | ||
494 | ch->asyncflags &= ~ASYNC_NORMAL_ACTIVE; | ||
495 | } | ||
496 | } | ||
497 | } | ||
498 | |||
499 | static int moxa_open(struct tty_struct *tty, struct file *filp) | 479 | static int moxa_open(struct tty_struct *tty, struct file *filp) |
500 | { | 480 | { |
501 | struct moxa_str *ch; | 481 | struct moxa_str *ch; |
@@ -908,8 +888,9 @@ static void moxa_poll(unsigned long ignored) | |||
908 | if (MoxaPortDCDON(ch->port)) | 888 | if (MoxaPortDCDON(ch->port)) |
909 | wake_up_interruptible(&ch->open_wait); | 889 | wake_up_interruptible(&ch->open_wait); |
910 | else { | 890 | else { |
911 | set_bit(MOXA_EVENT_HANGUP, &ch->event); | 891 | tty_hangup(tp); |
912 | schedule_work(&ch->tqueue); | 892 | wake_up_interruptible(&ch->open_wait); |
893 | ch->asyncflags &= ~ASYNC_NORMAL_ACTIVE; | ||
913 | } | 894 | } |
914 | } | 895 | } |
915 | } | 896 | } |