summaryrefslogtreecommitdiffstats
path: root/drivers/char/moxa.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2007-10-18 03:06:19 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 14:37:26 -0700
commitc43422053bea7a5ce09f18d0c50a606fe1a549f4 (patch)
treeee04c7bf4f6009f026c704db97032af370bcc19f /drivers/char/moxa.c
parentfc37449f7959aeedc2d38b183468ae73c9166fb6 (diff)
downloadop-kernel-dev-c43422053bea7a5ce09f18d0c50a606fe1a549f4.zip
op-kernel-dev-c43422053bea7a5ce09f18d0c50a606fe1a549f4.tar.gz
Char: moxa, fix and optimise empty timer
moxa, fix and optimise empty timer don't wait and delete empty timer in empty timer function. Also fire next empty timer at rounded jiffies to save power. 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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index ed76f0a..5000b3b 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -1040,14 +1040,14 @@ static void check_xmit_empty(unsigned long data)
struct moxa_port *ch;
ch = (struct moxa_port *) data;
- del_timer_sync(&moxa_ports[ch->port].emptyTimer);
if (ch->tty && (ch->statusflags & EMPTYWAIT)) {
if (MoxaPortTxQueue(ch->port) == 0) {
ch->statusflags &= ~EMPTYWAIT;
tty_wakeup(ch->tty);
return;
}
- mod_timer(&moxa_ports[ch->port].emptyTimer, jiffies + HZ);
+ mod_timer(&moxa_ports[ch->port].emptyTimer,
+ round_jiffies(jiffies + HZ));
} else
ch->statusflags &= ~EMPTYWAIT;
}
OpenPOWER on IntegriCloud