patch-2.4.0-test2 linux/drivers/isdn/avmb1/capi.c

Next file: linux/drivers/isdn/avmb1/capifs.c
Previous file: linux/drivers/isdn/avmb1/c4.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test1/linux/drivers/isdn/avmb1/capi.c linux/drivers/isdn/avmb1/capi.c
@@ -653,6 +653,7 @@
 					datahandle, skb->len);
 #endif
 		mp->tty->ldisc.receive_buf(mp->tty, skb->data, 0, skb->len);
+		kfree_skb(skb);
 		return 0;
 
 	} else if (mp->file) {
@@ -1197,7 +1198,6 @@
 	if ((file->private_data = capidev_alloc(file)) == 0)
 		return -ENOMEM;
 
-	MOD_INC_USE_COUNT;
 #ifdef _DEBUG_REFCOUNT
 	printk(KERN_DEBUG "capi_open %d\n", GET_USE_COUNT(THIS_MODULE));
 #endif
@@ -1211,7 +1211,6 @@
 	capincci_free(cdev, 0xffffffff);
 	capidev_free(cdev);
 
-	MOD_DEC_USE_COUNT;
 #ifdef _DEBUG_REFCOUNT
 	printk(KERN_DEBUG "capi_release %d\n", GET_USE_COUNT(THIS_MODULE));
 #endif
@@ -1220,6 +1219,7 @@
 
 static struct file_operations capi_fops =
 {
+	owner:		THIS_MODULE,
 	llseek:         capi_llseek,
 	read:           capi_read,
 	write:          capi_write,
@@ -1407,18 +1407,14 @@
 
 struct file_operations capinc_raw_fops =
 {
-	capinc_raw_llseek,
-	capinc_raw_read,
-	capinc_raw_write,
-	NULL,			/* capi_readdir */
-	capinc_raw_poll,
-	capinc_raw_ioctl,
-	NULL,			/* capi_mmap */
-	capinc_raw_open,
-        NULL,                   /* capi_flush */
-	capinc_raw_release,
-	NULL,			/* capi_fsync */
-	NULL,			/* capi_fasync */
+	owner:		THIS_MODULE,
+	llseek:		capinc_raw_llseek,
+	read:		capinc_raw_read,
+	write:		capinc_raw_write,
+	poll:		capinc_raw_poll,
+	ioctl:		capinc_raw_ioctl,
+	open:		capinc_raw_open,
+	release:	capinc_raw_release,
 };
 
 /* -------- tty_operations for capincci ----------------------------- */
@@ -1879,7 +1875,7 @@
 		*eof = 1;
 	if (off >= len+begin)
 		return 0;
-	*start = page + (begin-off);
+	*start = page + (off-begin);
 	return ((count < begin+len-off) ? count : begin+len-off);
 }
 
@@ -2057,11 +2053,11 @@
         devfs_register_series (NULL, "capi/r%u", CAPINC_NR_PORTS,
 			      DEVFS_FL_DEFAULT,
                               capi_rawmajor, 0,
-                              S_IFCHR | S_IRUSR | S_IWUSR, 0, 0,
+                              S_IFCHR | S_IRUSR | S_IWUSR,
                               &capinc_raw_fops, NULL);
 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
-	devfs_register (NULL, "isdn/capi20", 0, DEVFS_FL_DEFAULT,
-			capi_major, 0, S_IFCHR | S_IRUSR | S_IWUSR, 0, 0,
+	devfs_register (NULL, "isdn/capi20", DEVFS_FL_DEFAULT,
+			capi_major, 0, S_IFCHR | S_IRUSR | S_IWUSR,
 			&capi_fops, NULL);
 	printk(KERN_NOTICE "capi20: started up with major %d\n", capi_major);
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)