[PATCH 4/8] Char: moxa, remove hangup bottomhalf
- From: Jiri Slaby <jirislaby@xxxxxxxxx>
- Date: Sun, 31 Dec 2006 02:04:50 +0100 (CET)
moxa, remove hangup bottomhalf
call tty_hangup directly, we do not need a bottomhalf for this.
Signed-off-by: Jiri Slaby <jirislaby@xxxxxxxxx>
---
commit 9146480faf6469f789229e4f09d99a90b3e05c26
tree 58eb5f2f3943a17ad05b3fd869ab987e63a4fe14
parent 8171e38961018ef16df52084d1356f891f43ba6f
author Jiri Slaby <jirislaby@xxxxxxxxx> Sun, 31 Dec 2006 01:42:55 +0059
committer Jiri Slaby <jirislaby@xxxxxxxxx> 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;
}
}
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- References:
- [PATCH 1/8] Char: moxa, remove unused allocated page
- From: Jiri Slaby
- [PATCH 1/8] Char: moxa, remove unused allocated page
- Prev by Date: [PATCH 2/8] Char: moxa, do not initialize global static
- Next by Date: [PATCH 3/8] Char: moxa, timers cleanup
- Previous by thread: [PATCH 2/8] Char: moxa, do not initialize global static
- Next by thread: [PATCH 3/8] Char: moxa, timers cleanup
- Index(es):
Relevant Pages
- Re: [PATCH] MM: use DIV_ROUND_UP() in mm/memory.c
... tree 8037adc04b57cd6150456399b7caccf99489385a ... parent bf0bd376f79cadb4f8cd454db1723eb9be0aabc1
... struct zap_details details; ... (Linux-Kernel) - [PATCH] fix Linux kernel ELF core dump privilege elevation
... tree 440fdf47fcddf8b0d615667b418981a511d16e30 ... parent d3f0fcec2d50a18a84c4f3dd7683206ed37ca009
... static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p, ...
send the line "unsubscribe linux-kernel" in ... (Linux-Kernel) - [PATCH] USB: fix show_modalias() function due to attribute change
... tree 4f6637cf3496fa9d6d645d38680d542c21e8b263 ... parent 9d9d27fb651a7c95a46f276bacb4329db47470a6
... struct usb_interface *intf; ... send the line "unsubscribe linux-kernel"
in ... (Linux-Kernel) - [PATCH 5/7] Char: moxa, remove useless vairables
... tree ef1ddd6847925a86aa7041a540646dc0dc543c62 ... parent 5ac07b4e2356931b4548316037b537f980bd8ab9
... struct timer_list emptyTimer; ... (Linux-Kernel) - [PATCH 4/21] Char: cyclades, unexport struct cyclades_card
... cyclades, unexport struct cyclades_card ... tree c124038b4c9749bd161bde189829700957b98a4f
... parent 3441ca636014ff919d5b2b2e920b76dbe7ed9686 ... (Linux-Kernel)