Commit ba196df3 authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds

[PATCH] Char: moxa, remove hangup bottomhalf

Call tty_hangup directly, we do not need a bottomhalf for this.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent aa7e5221
...@@ -159,7 +159,6 @@ struct moxa_str { ...@@ -159,7 +159,6 @@ struct moxa_str {
int cflag; int cflag;
wait_queue_head_t open_wait; wait_queue_head_t open_wait;
wait_queue_head_t close_wait; wait_queue_head_t close_wait;
struct work_struct tqueue;
}; };
struct mxser_mstatus { struct mxser_mstatus {
...@@ -178,9 +177,6 @@ static struct mxser_mstatus GMStatus[MAX_PORTS]; ...@@ -178,9 +177,6 @@ static struct mxser_mstatus GMStatus[MAX_PORTS];
#define EMPTYWAIT 0x4 #define EMPTYWAIT 0x4
#define THROTTLE 0x8 #define THROTTLE 0x8
/* event */
#define MOXA_EVENT_HANGUP 1
#define SERIAL_DO_RESTART #define SERIAL_DO_RESTART
...@@ -213,7 +209,6 @@ module_param(verbose, bool, 0644); ...@@ -213,7 +209,6 @@ module_param(verbose, bool, 0644);
/* /*
* static functions: * static functions:
*/ */
static void do_moxa_softint(struct work_struct *);
static int moxa_open(struct tty_struct *, struct file *); static int moxa_open(struct tty_struct *, struct file *);
static void moxa_close(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); static int moxa_write(struct tty_struct *, const unsigned char *, int);
...@@ -354,7 +349,6 @@ static int __init moxa_init(void) ...@@ -354,7 +349,6 @@ static int __init moxa_init(void)
for (i = 0, ch = moxaChannels; i < MAX_PORTS; i++, ch++) { for (i = 0, ch = moxaChannels; i < MAX_PORTS; i++, ch++) {
ch->type = PORT_16550A; ch->type = PORT_16550A;
ch->port = i; ch->port = i;
INIT_WORK(&ch->tqueue, do_moxa_softint);
ch->close_delay = 5 * HZ / 10; ch->close_delay = 5 * HZ / 10;
ch->closing_wait = 30 * HZ; ch->closing_wait = 30 * HZ;
ch->cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL; ch->cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;
...@@ -482,20 +476,6 @@ static void __exit moxa_exit(void) ...@@ -482,20 +476,6 @@ static void __exit moxa_exit(void)
module_init(moxa_init); module_init(moxa_init);
module_exit(moxa_exit); 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) static int moxa_open(struct tty_struct *tty, struct file *filp)
{ {
struct moxa_str *ch; struct moxa_str *ch;
...@@ -908,8 +888,9 @@ static void moxa_poll(unsigned long ignored) ...@@ -908,8 +888,9 @@ static void moxa_poll(unsigned long ignored)
if (MoxaPortDCDON(ch->port)) if (MoxaPortDCDON(ch->port))
wake_up_interruptible(&ch->open_wait); wake_up_interruptible(&ch->open_wait);
else { else {
set_bit(MOXA_EVENT_HANGUP, &ch->event); tty_hangup(tp);
schedule_work(&ch->tqueue); wake_up_interruptible(&ch->open_wait);
ch->asyncflags &= ~ASYNC_NORMAL_ACTIVE;
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment