Commit 8c6cc488 authored by Hanna V. Linder's avatar Hanna V. Linder Committed by Greg Kroah-Hartman

[PATCH] stallion tty_driver add .owner field remove MOD_INC/DEC_USE_COUNT

parent 129738d3
...@@ -1044,8 +1044,6 @@ static int stl_open(struct tty_struct *tty, struct file *filp) ...@@ -1044,8 +1044,6 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
if (portp == (stlport_t *) NULL) if (portp == (stlport_t *) NULL)
return(-ENODEV); return(-ENODEV);
MOD_INC_USE_COUNT;
/* /*
* On the first open of the device setup the port hardware, and * On the first open of the device setup the port hardware, and
* initialize the per port data structure. * initialize the per port data structure.
...@@ -1207,14 +1205,12 @@ static void stl_close(struct tty_struct *tty, struct file *filp) ...@@ -1207,14 +1205,12 @@ static void stl_close(struct tty_struct *tty, struct file *filp)
save_flags(flags); save_flags(flags);
cli(); cli();
if (tty_hung_up_p(filp)) { if (tty_hung_up_p(filp)) {
MOD_DEC_USE_COUNT;
restore_flags(flags); restore_flags(flags);
return; return;
} }
if ((tty->count == 1) && (portp->refcount != 1)) if ((tty->count == 1) && (portp->refcount != 1))
portp->refcount = 1; portp->refcount = 1;
if (portp->refcount-- > 1) { if (portp->refcount-- > 1) {
MOD_DEC_USE_COUNT;
restore_flags(flags); restore_flags(flags);
return; return;
} }
...@@ -1267,7 +1263,6 @@ static void stl_close(struct tty_struct *tty, struct file *filp) ...@@ -1267,7 +1263,6 @@ static void stl_close(struct tty_struct *tty, struct file *filp)
portp->flags &= ~(ASYNC_CALLOUT_ACTIVE | ASYNC_NORMAL_ACTIVE | portp->flags &= ~(ASYNC_CALLOUT_ACTIVE | ASYNC_NORMAL_ACTIVE |
ASYNC_CLOSING); ASYNC_CLOSING);
wake_up_interruptible(&portp->close_wait); wake_up_interruptible(&portp->close_wait);
MOD_DEC_USE_COUNT;
restore_flags(flags); restore_flags(flags);
} }
...@@ -2241,11 +2236,11 @@ static void stl_offintr(void *private) ...@@ -2241,11 +2236,11 @@ static void stl_offintr(void *private)
#endif #endif
if (portp == (stlport_t *) NULL) if (portp == (stlport_t *) NULL)
goto out; return;
tty = portp->tty; tty = portp->tty;
if (tty == (struct tty_struct *) NULL) if (tty == (struct tty_struct *) NULL)
goto out; return;
lock_kernel(); lock_kernel();
if (test_bit(ASYI_TXLOW, &portp->istate)) { if (test_bit(ASYI_TXLOW, &portp->istate)) {
...@@ -2270,8 +2265,6 @@ static void stl_offintr(void *private) ...@@ -2270,8 +2265,6 @@ static void stl_offintr(void *private)
} }
} }
unlock_kernel(); unlock_kernel();
out:
MOD_DEC_USE_COUNT;
} }
/*****************************************************************************/ /*****************************************************************************/
...@@ -3231,6 +3224,7 @@ int __init stl_init(void) ...@@ -3231,6 +3224,7 @@ int __init stl_init(void)
*/ */
memset(&stl_serial, 0, sizeof(struct tty_driver)); memset(&stl_serial, 0, sizeof(struct tty_driver));
stl_serial.magic = TTY_DRIVER_MAGIC; stl_serial.magic = TTY_DRIVER_MAGIC;
stl_serial.owner = THIS_MODULE;
stl_serial.driver_name = stl_drvname; stl_serial.driver_name = stl_drvname;
stl_serial.name = stl_serialname; stl_serial.name = stl_serialname;
stl_serial.major = STL_SERIALMAJOR; stl_serial.major = STL_SERIALMAJOR;
...@@ -4136,9 +4130,7 @@ static void stl_cd1400txisr(stlpanel_t *panelp, int ioaddr) ...@@ -4136,9 +4130,7 @@ static void stl_cd1400txisr(stlpanel_t *panelp, int ioaddr)
if ((len == 0) || ((len < STL_TXBUFLOW) && if ((len == 0) || ((len < STL_TXBUFLOW) &&
(test_bit(ASYI_TXLOW, &portp->istate) == 0))) { (test_bit(ASYI_TXLOW, &portp->istate) == 0))) {
set_bit(ASYI_TXLOW, &portp->istate); set_bit(ASYI_TXLOW, &portp->istate);
MOD_INC_USE_COUNT; schedule_work(&portp->tqueue);
if (schedule_work(&portp->tqueue) == 0)
MOD_DEC_USE_COUNT;
} }
if (len == 0) { if (len == 0) {
...@@ -4318,9 +4310,7 @@ static void stl_cd1400mdmisr(stlpanel_t *panelp, int ioaddr) ...@@ -4318,9 +4310,7 @@ static void stl_cd1400mdmisr(stlpanel_t *panelp, int ioaddr)
misr = inb(ioaddr + EREG_DATA); misr = inb(ioaddr + EREG_DATA);
if (misr & MISR_DCD) { if (misr & MISR_DCD) {
set_bit(ASYI_DCDCHANGE, &portp->istate); set_bit(ASYI_DCDCHANGE, &portp->istate);
MOD_INC_USE_COUNT; schedule_task(&portp->tqueue);
if (schedule_task(&portp->tqueue) == 0)
MOD_DEC_USE_COUNT;
portp->stats.modem++; portp->stats.modem++;
} }
...@@ -5117,9 +5107,7 @@ static void stl_sc26198txisr(stlport_t *portp) ...@@ -5117,9 +5107,7 @@ static void stl_sc26198txisr(stlport_t *portp)
if ((len == 0) || ((len < STL_TXBUFLOW) && if ((len == 0) || ((len < STL_TXBUFLOW) &&
(test_bit(ASYI_TXLOW, &portp->istate) == 0))) { (test_bit(ASYI_TXLOW, &portp->istate) == 0))) {
set_bit(ASYI_TXLOW, &portp->istate); set_bit(ASYI_TXLOW, &portp->istate);
MOD_INC_USE_COUNT; schedule_task(&portp->tqueue);
if (schedule_task(&portp->tqueue) == 0)
MOD_DEC_USE_COUNT;
} }
if (len == 0) { if (len == 0) {
...@@ -5336,9 +5324,7 @@ static void stl_sc26198otherisr(stlport_t *portp, unsigned int iack) ...@@ -5336,9 +5324,7 @@ static void stl_sc26198otherisr(stlport_t *portp, unsigned int iack)
ipr = stl_sc26198getreg(portp, IPR); ipr = stl_sc26198getreg(portp, IPR);
if (ipr & IPR_DCDCHANGE) { if (ipr & IPR_DCDCHANGE) {
set_bit(ASYI_DCDCHANGE, &portp->istate); set_bit(ASYI_DCDCHANGE, &portp->istate);
MOD_INC_USE_COUNT; schedule_task(&portp->tqueue);
if (schedule_task(&portp->tqueue) == 0)
MOD_DEC_USE_COUNT;
portp->stats.modem++; portp->stats.modem++;
} }
break; break;
......
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