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

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

parent c5faa90f
...@@ -501,6 +501,7 @@ static int __init mxser_module_init(void) ...@@ -501,6 +501,7 @@ static int __init mxser_module_init(void)
memset(&mxvar_sdriver, 0, sizeof(struct tty_driver)); memset(&mxvar_sdriver, 0, sizeof(struct tty_driver));
mxvar_sdriver.magic = TTY_DRIVER_MAGIC; mxvar_sdriver.magic = TTY_DRIVER_MAGIC;
mxvar_sdriver.owner = THIS_MODULE;
mxvar_sdriver.name = "ttyM"; mxvar_sdriver.name = "ttyM";
mxvar_sdriver.major = ttymajor; mxvar_sdriver.major = ttymajor;
mxvar_sdriver.minor_start = 0; mxvar_sdriver.minor_start = 0;
...@@ -708,7 +709,6 @@ static void mxser_do_softint(void *private_) ...@@ -708,7 +709,6 @@ static void mxser_do_softint(void *private_)
tty_hangup(tty); /* FIXME: module removal race here - AKPM */ tty_hangup(tty); /* FIXME: module removal race here - AKPM */
} }
} }
MOD_DEC_USE_COUNT;
} }
/* /*
...@@ -767,8 +767,6 @@ static int mxser_open(struct tty_struct *tty, struct file *filp) ...@@ -767,8 +767,6 @@ static int mxser_open(struct tty_struct *tty, struct file *filp)
info->session = current->session; info->session = current->session;
info->pgrp = current->pgrp; info->pgrp = current->pgrp;
MOD_INC_USE_COUNT;
return (0); return (0);
} }
...@@ -795,7 +793,6 @@ static void mxser_close(struct tty_struct *tty, struct file *filp) ...@@ -795,7 +793,6 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
if (tty_hung_up_p(filp)) { if (tty_hung_up_p(filp)) {
restore_flags(flags); restore_flags(flags);
MOD_DEC_USE_COUNT;
return; return;
} }
if ((tty->count == 1) && (info->count != 1)) { if ((tty->count == 1) && (info->count != 1)) {
...@@ -817,7 +814,6 @@ static void mxser_close(struct tty_struct *tty, struct file *filp) ...@@ -817,7 +814,6 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
} }
if (info->count) { if (info->count) {
restore_flags(flags); restore_flags(flags);
MOD_DEC_USE_COUNT;
return; return;
} }
info->flags |= ASYNC_CLOSING; info->flags |= ASYNC_CLOSING;
...@@ -881,7 +877,6 @@ static void mxser_close(struct tty_struct *tty, struct file *filp) ...@@ -881,7 +877,6 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
wake_up_interruptible(&info->close_wait); wake_up_interruptible(&info->close_wait);
restore_flags(flags); restore_flags(flags);
MOD_DEC_USE_COUNT;
} }
static int mxser_write(struct tty_struct *tty, int from_user, static int mxser_write(struct tty_struct *tty, int from_user,
...@@ -1492,9 +1487,7 @@ static inline void mxser_transmit_chars(struct mxser_struct *info) ...@@ -1492,9 +1487,7 @@ static inline void mxser_transmit_chars(struct mxser_struct *info)
if (info->xmit_cnt < WAKEUP_CHARS) { if (info->xmit_cnt < WAKEUP_CHARS) {
set_bit(MXSER_EVENT_TXLOW, &info->event); set_bit(MXSER_EVENT_TXLOW, &info->event);
MOD_INC_USE_COUNT; schedule_work(&info->tqueue);
if (schedule_work(&info->tqueue) == 0)
MOD_DEC_USE_COUNT;
} }
if (info->xmit_cnt <= 0) { if (info->xmit_cnt <= 0) {
info->IER &= ~UART_IER_THRI; info->IER &= ~UART_IER_THRI;
...@@ -1523,9 +1516,7 @@ static inline void mxser_check_modem_status(struct mxser_struct *info, ...@@ -1523,9 +1516,7 @@ static inline void mxser_check_modem_status(struct mxser_struct *info,
else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) && else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) &&
(info->flags & ASYNC_CALLOUT_NOHUP))) (info->flags & ASYNC_CALLOUT_NOHUP)))
set_bit(MXSER_EVENT_HANGUP, &info->event); set_bit(MXSER_EVENT_HANGUP, &info->event);
MOD_INC_USE_COUNT; schedule_work(&info->tqueue);
if (schedule_work(&info->tqueue) == 0)
MOD_DEC_USE_COUNT;
} }
if (info->flags & ASYNC_CTS_FLOW) { if (info->flags & ASYNC_CTS_FLOW) {
if (info->tty->hw_stopped) { if (info->tty->hw_stopped) {
...@@ -1535,9 +1526,7 @@ static inline void mxser_check_modem_status(struct mxser_struct *info, ...@@ -1535,9 +1526,7 @@ static inline void mxser_check_modem_status(struct mxser_struct *info,
outb(info->IER, info->base + UART_IER); outb(info->IER, info->base + UART_IER);
set_bit(MXSER_EVENT_TXLOW, &info->event); set_bit(MXSER_EVENT_TXLOW, &info->event);
MOD_INC_USE_COUNT; schedule_work(&info->tqueue);
if (schedule_work(&info->tqueue) == 0)
MOD_DEC_USE_COUNT;
} }
} else { } else {
if (!(status & UART_MSR_CTS)) { if (!(status & UART_MSR_CTS)) {
......
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