]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/open.c
Merge branch 'master' into can-usb1
[lincan.git] / lincan / src / open.c
index f785e2c17efe5212b1680d1b2ababec2512122c9..942225a8fbaa4c726340e98a5fc6753d6b311a59 100644 (file)
@@ -82,6 +82,10 @@ int can_open(struct inode *inode, struct file *file)
                        CANMSG("Error initializing chip for receiving\n");
        }
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10))
+       if (chip->hostdevice->hwspecops->release_device)
+               kref_get(&chip->hostdevice->refcount);
+#endif
 
        canuser = (struct canuser_t *)kmalloc(sizeof(struct canuser_t), GFP_KERNEL);
        if(canuser == NULL) goto no_canuser;