Commit d116adb1 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by David Mosberger

[PATCH] ia64: simserial module refcounting update

parent 2809648f
...@@ -636,7 +636,6 @@ static void rs_close(struct tty_struct *tty, struct file * filp) ...@@ -636,7 +636,6 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
#ifdef SIMSERIAL_DEBUG #ifdef SIMSERIAL_DEBUG
printk("rs_close: hung_up\n"); printk("rs_close: hung_up\n");
#endif #endif
MOD_DEC_USE_COUNT;
local_irq_restore(flags); local_irq_restore(flags);
return; return;
} }
...@@ -661,7 +660,6 @@ static void rs_close(struct tty_struct *tty, struct file * filp) ...@@ -661,7 +660,6 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
state->count = 0; state->count = 0;
} }
if (state->count) { if (state->count) {
MOD_DEC_USE_COUNT;
local_irq_restore(flags); local_irq_restore(flags);
return; return;
} }
...@@ -686,7 +684,6 @@ static void rs_close(struct tty_struct *tty, struct file * filp) ...@@ -686,7 +684,6 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
} }
info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
wake_up_interruptible(&info->close_wait); wake_up_interruptible(&info->close_wait);
MOD_DEC_USE_COUNT;
} }
/* /*
...@@ -874,17 +871,12 @@ static int rs_open(struct tty_struct *tty, struct file * filp) ...@@ -874,17 +871,12 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
int retval, line; int retval, line;
unsigned long page; unsigned long page;
MOD_INC_USE_COUNT;
line = tty->index; line = tty->index;
if ((line < 0) || (line >= NR_PORTS)) { if ((line < 0) || (line >= NR_PORTS))
MOD_DEC_USE_COUNT;
return -ENODEV; return -ENODEV;
}
retval = get_async_struct(line, &info); retval = get_async_struct(line, &info);
if (retval) { if (retval)
MOD_DEC_USE_COUNT;
return retval; return retval;
}
tty->driver_data = info; tty->driver_data = info;
info->tty = tty; info->tty = tty;
...@@ -895,10 +887,8 @@ static int rs_open(struct tty_struct *tty, struct file * filp) ...@@ -895,10 +887,8 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
if (!tmp_buf) { if (!tmp_buf) {
page = get_zeroed_page(GFP_KERNEL); page = get_zeroed_page(GFP_KERNEL);
if (!page) { if (!page)
/* MOD_DEC_USE_COUNT; "info->tty" will cause this? */
return -ENOMEM; return -ENOMEM;
}
if (tmp_buf) if (tmp_buf)
free_page(page); free_page(page);
else else
...@@ -912,7 +902,6 @@ static int rs_open(struct tty_struct *tty, struct file * filp) ...@@ -912,7 +902,6 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
(info->flags & ASYNC_CLOSING)) { (info->flags & ASYNC_CLOSING)) {
if (info->flags & ASYNC_CLOSING) if (info->flags & ASYNC_CLOSING)
interruptible_sleep_on(&info->close_wait); interruptible_sleep_on(&info->close_wait);
/* MOD_DEC_USE_COUNT; "info->tty" will cause this? */
#ifdef SERIAL_DO_RESTART #ifdef SERIAL_DO_RESTART
return ((info->flags & ASYNC_HUP_NOTIFY) ? return ((info->flags & ASYNC_HUP_NOTIFY) ?
-EAGAIN : -ERESTARTSYS); -EAGAIN : -ERESTARTSYS);
...@@ -926,7 +915,6 @@ static int rs_open(struct tty_struct *tty, struct file * filp) ...@@ -926,7 +915,6 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
*/ */
retval = startup(info); retval = startup(info);
if (retval) { if (retval) {
/* MOD_DEC_USE_COUNT; "info->tty" will cause this? */
return retval; return retval;
} }
...@@ -1042,6 +1030,7 @@ simrs_init (void) ...@@ -1042,6 +1030,7 @@ simrs_init (void)
/* Initialize the tty_driver structure */ /* Initialize the tty_driver structure */
hp_simserial_driver->owner = THIS_MODULE;
hp_simserial_driver->driver_name = "simserial"; hp_simserial_driver->driver_name = "simserial";
hp_simserial_driver->name = "ttyS"; hp_simserial_driver->name = "ttyS";
hp_simserial_driver->major = TTY_MAJOR; hp_simserial_driver->major = TTY_MAJOR;
......
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