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

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

parent 5fa62d1f
...@@ -200,10 +200,8 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci) ...@@ -200,10 +200,8 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci)
unsigned int minor = 0; unsigned int minor = 0;
unsigned long flags; unsigned long flags;
MOD_INC_USE_COUNT;
mp = kmalloc(sizeof(*mp), GFP_ATOMIC); mp = kmalloc(sizeof(*mp), GFP_ATOMIC);
if (!mp) { if (!mp) {
MOD_DEC_USE_COUNT;
printk(KERN_ERR "capi: can't alloc capiminor\n"); printk(KERN_ERR "capi: can't alloc capiminor\n");
return 0; return 0;
} }
...@@ -249,7 +247,6 @@ static void capiminor_free(struct capiminor *mp) ...@@ -249,7 +247,6 @@ static void capiminor_free(struct capiminor *mp)
skb_queue_purge(&mp->outqueue); skb_queue_purge(&mp->outqueue);
capiminor_del_all_ack(mp); capiminor_del_all_ack(mp);
kfree(mp); kfree(mp);
MOD_DEC_USE_COUNT;
} }
struct capiminor *capiminor_find(unsigned int minor) struct capiminor *capiminor_find(unsigned int minor)
...@@ -1280,6 +1277,7 @@ static int capinc_tty_init(void) ...@@ -1280,6 +1277,7 @@ static int capinc_tty_init(void)
memset(drv, 0, sizeof(struct tty_driver)); memset(drv, 0, sizeof(struct tty_driver));
drv->magic = TTY_DRIVER_MAGIC; drv->magic = TTY_DRIVER_MAGIC;
drv->owner = THIS_MODULE;
drv->driver_name = "capi_nc"; drv->driver_name = "capi_nc";
drv->name = "capi/"; drv->name = "capi/";
drv->major = capi_ttymajor; drv->major = capi_ttymajor;
...@@ -1460,7 +1458,6 @@ static int __init capi_init(void) ...@@ -1460,7 +1458,6 @@ static int __init capi_init(void)
char *p; char *p;
char *compileinfo; char *compileinfo;
MOD_INC_USE_COUNT;
if ((p = strchr(revision, ':')) != 0 && p[1]) { if ((p = strchr(revision, ':')) != 0 && p[1]) {
strncpy(rev, p + 2, sizeof(rev)); strncpy(rev, p + 2, sizeof(rev));
...@@ -1472,7 +1469,6 @@ static int __init capi_init(void) ...@@ -1472,7 +1469,6 @@ static int __init capi_init(void)
if (register_chrdev(capi_major, "capi20", &capi_fops)) { if (register_chrdev(capi_major, "capi20", &capi_fops)) {
printk(KERN_ERR "capi20: unable to get major %d\n", capi_major); printk(KERN_ERR "capi20: unable to get major %d\n", capi_major);
MOD_DEC_USE_COUNT;
return -EIO; return -EIO;
} }
...@@ -1484,7 +1480,6 @@ static int __init capi_init(void) ...@@ -1484,7 +1480,6 @@ static int __init capi_init(void)
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
if (capinc_tty_init() < 0) { if (capinc_tty_init() < 0) {
unregister_chrdev(capi_major, "capi20"); unregister_chrdev(capi_major, "capi20");
MOD_DEC_USE_COUNT;
return -ENOMEM; return -ENOMEM;
} }
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
...@@ -1503,7 +1498,6 @@ static int __init capi_init(void) ...@@ -1503,7 +1498,6 @@ static int __init capi_init(void)
printk(KERN_NOTICE "capi20: Rev %s: started up with major %d%s\n", printk(KERN_NOTICE "capi20: Rev %s: started up with major %d%s\n",
rev, capi_major, compileinfo); rev, capi_major, compileinfo);
MOD_DEC_USE_COUNT;
return 0; return 0;
} }
......
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