Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95196
b: refs/heads/master
c: 2a54134
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Apr 30, 2008
1 parent ba08b55 commit bf87670
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2108eba5c531c12f5ae2ed2ef4cee7bf4246897b
refs/heads/master: 2a5413416b6b2fd8a5a38601a4fe3b56a52cfb86
26 changes: 15 additions & 11 deletions trunk/drivers/char/moxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,10 +846,11 @@ static int moxa_init_board(struct moxa_board_conf *brd, struct device *dev)
if (ret)
goto err_free;

spin_lock_bh(&moxa_lock);
brd->ready = 1;

if (!timer_pending(&moxaTimer))
mod_timer(&moxaTimer, jiffies + HZ / 50);
spin_unlock_bh(&moxa_lock);

return 0;
err_free:
Expand Down Expand Up @@ -1041,20 +1042,20 @@ static void __exit moxa_exit(void)
{
int i;

del_timer_sync(&moxaTimer);

if (tty_unregister_driver(moxaDriver))
printk(KERN_ERR "Couldn't unregister MOXA Intellio family "
"serial driver\n");
put_tty_driver(moxaDriver);

#ifdef CONFIG_PCI
pci_unregister_driver(&moxa_pci_driver);
#endif

for (i = 0; i < MAX_BOARDS; i++) /* ISA boards */
if (moxa_boards[i].ready)
moxa_board_deinit(&moxa_boards[i]);

del_timer_sync(&moxaTimer);

if (tty_unregister_driver(moxaDriver))
printk(KERN_ERR "Couldn't unregister MOXA Intellio family "
"serial driver\n");
put_tty_driver(moxaDriver);
}

module_init(moxa_init);
Expand Down Expand Up @@ -1432,14 +1433,16 @@ static void moxa_poll(unsigned long ignored)
{
struct moxa_board_conf *brd;
u16 __iomem *ip;
unsigned int card, port;
unsigned int card, port, served = 0;

spin_lock(&moxa_lock);
for (card = 0; card < MAX_BOARDS; card++) {
brd = &moxa_boards[card];
if (!brd->ready)
continue;

served++;

ip = NULL;
if (readb(brd->intPend) == 0xff)
ip = brd->intTable + readb(brd->intNdx);
Expand All @@ -1460,9 +1463,10 @@ static void moxa_poll(unsigned long ignored)
}
}
moxaLowWaterChk = 0;
spin_unlock(&moxa_lock);

mod_timer(&moxaTimer, jiffies + HZ / 50);
if (served)
mod_timer(&moxaTimer, jiffies + HZ / 50);
spin_unlock(&moxa_lock);
}

/******************************************************************************/
Expand Down

0 comments on commit bf87670

Please sign in to comment.