Commit 8f1b2d39 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] tty_driver add .owner field remove MOD_INC_DEC_USE_COUNT

From:  Hanna Linder <hannal@us.ibm.com>

  Here are the changes for s390 to set .owner for tty_drivers
  and remove MOD_INC/DEC_USE_COUNT. Martin has already approved
  this.
parent 6a4819c1
...@@ -1178,6 +1178,7 @@ tty3215_init(void) ...@@ -1178,6 +1178,7 @@ tty3215_init(void)
memset(&tty3215_driver, 0, sizeof(struct tty_driver)); memset(&tty3215_driver, 0, sizeof(struct tty_driver));
tty3215_driver.magic = TTY_DRIVER_MAGIC; tty3215_driver.magic = TTY_DRIVER_MAGIC;
tty3215_driver.owner = THIS_MODULE;
tty3215_driver.driver_name = "tty3215"; tty3215_driver.driver_name = "tty3215";
tty3215_driver.name = "ttyS"; tty3215_driver.name = "ttyS";
tty3215_driver.name_base = 0; tty3215_driver.name_base = 0;
......
...@@ -743,6 +743,7 @@ sclp_tty_init(void) ...@@ -743,6 +743,7 @@ sclp_tty_init(void)
memset (&sclp_tty_driver, 0, sizeof(struct tty_driver)); memset (&sclp_tty_driver, 0, sizeof(struct tty_driver));
sclp_tty_driver.magic = TTY_DRIVER_MAGIC; sclp_tty_driver.magic = TTY_DRIVER_MAGIC;
sclp_tty_driver.owner = THIS_MODULE;
sclp_tty_driver.driver_name = "tty_sclp"; sclp_tty_driver.driver_name = "tty_sclp";
sclp_tty_driver.name = "ttyS"; sclp_tty_driver.name = "ttyS";
sclp_tty_driver.name_base = 0; sclp_tty_driver.name_base = 0;
......
...@@ -218,18 +218,6 @@ cleanup_module(void) ...@@ -218,18 +218,6 @@ cleanup_module(void)
} }
#endif /* Not a MODULE or a MODULE */ #endif /* Not a MODULE or a MODULE */
void
tub_inc_use_count(void)
{
MOD_INC_USE_COUNT;
}
void
tub_dec_use_count(void)
{
MOD_DEC_USE_COUNT;
}
static int static int
tub3270_is_ours(s390_dev_info_t *dp) tub3270_is_ours(s390_dev_info_t *dp)
{ {
......
...@@ -118,7 +118,6 @@ fs3270_open(struct inode *ip, struct file *fp) ...@@ -118,7 +118,6 @@ fs3270_open(struct inode *ip, struct file *fp)
return -EBUSY; return -EBUSY;
} }
tub_inc_use_count();
fp->private_data = ip; fp->private_data = ip;
tubp->mode = TBM_FS; tubp->mode = TBM_FS;
tubp->intv = fs3270_int; tubp->intv = fs3270_int;
...@@ -144,7 +143,6 @@ fs3270_close(struct inode *ip, struct file *fp) ...@@ -144,7 +143,6 @@ fs3270_close(struct inode *ip, struct file *fp)
fs3270_wait(tubp, &flags); fs3270_wait(tubp, &flags);
tubp->fsopen = 0; tubp->fsopen = 0;
tubp->fs_pid = 0; tubp->fs_pid = 0;
tub_dec_use_count();
tubp->intv = NULL; tubp->intv = NULL;
tubp->mode = 0; tubp->mode = 0;
tty3270_refresh(tubp); tty3270_refresh(tubp);
...@@ -165,7 +163,6 @@ fs3270_release(tub_t *tubp) ...@@ -165,7 +163,6 @@ fs3270_release(tub_t *tubp)
fs3270_wait(tubp, &flags); fs3270_wait(tubp, &flags);
tubp->fsopen = 0; tubp->fsopen = 0;
tubp->fs_pid = 0; tubp->fs_pid = 0;
tub_dec_use_count();
tubp->intv = NULL; tubp->intv = NULL;
tubp->mode = 0; tubp->mode = 0;
/*tty3270_refresh(tubp);*/ /*tty3270_refresh(tubp);*/
......
...@@ -421,8 +421,6 @@ extern inline tub_t *TTY2TUB(struct tty_struct *tty) ...@@ -421,8 +421,6 @@ extern inline tub_t *TTY2TUB(struct tty_struct *tty)
return tubp; return tubp;
} }
extern void tub_inc_use_count(void);
extern void tub_dec_use_count(void);
extern int tub3270_movedata(bcb_t *, bcb_t *, int); extern int tub3270_movedata(bcb_t *, bcb_t *, int);
#if 0 #if 0
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)) #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
......
...@@ -80,6 +80,7 @@ tty3270_init(void) ...@@ -80,6 +80,7 @@ tty3270_init(void)
/* Initialize for tty driver */ /* Initialize for tty driver */
td->magic = TTY_DRIVER_MAGIC; td->magic = TTY_DRIVER_MAGIC;
td->owner = THIS_MODULE;
td->driver_name = "tty3270"; td->driver_name = "tty3270";
td->name = "tty3270"; td->name = "tty3270";
td->major = IBM_TTY3270_MAJOR; td->major = IBM_TTY3270_MAJOR;
...@@ -189,7 +190,6 @@ tty3270_open(struct tty_struct *tty, struct file *filp) ...@@ -189,7 +190,6 @@ tty3270_open(struct tty_struct *tty, struct file *filp)
return -ENODEV; return -ENODEV;
} }
tub_inc_use_count();
if ((rc = tty3270_wait(tubp, &flags)) != 0) if ((rc = tty3270_wait(tubp, &flags)) != 0)
goto do_fail; goto do_fail;
if (tubp->lnopen > 0) { if (tubp->lnopen > 0) {
...@@ -231,7 +231,6 @@ tty3270_open(struct tty_struct *tty, struct file *filp) ...@@ -231,7 +231,6 @@ tty3270_open(struct tty_struct *tty, struct file *filp)
tty3270_aid_fini(tubp); tty3270_aid_fini(tubp);
tty3270_rcl_fini(tubp); tty3270_rcl_fini(tubp);
TUBUNLOCK(tubp->irq, flags); TUBUNLOCK(tubp->irq, flags);
tub_dec_use_count();
return rc; return rc;
} }
...@@ -253,7 +252,6 @@ tty3270_close(struct tty_struct *tty, struct file *filp) ...@@ -253,7 +252,6 @@ tty3270_close(struct tty_struct *tty, struct file *filp)
tty3270_rcl_fini(tubp); tty3270_rcl_fini(tubp);
tty3270_scl_fini(tubp); tty3270_scl_fini(tubp);
do_return: do_return:
tub_dec_use_count();
TUBUNLOCK(tubp->irq, flags); TUBUNLOCK(tubp->irq, flags);
} }
......
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