]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/setup.c
reference count for device opens added (helps while asynchronous remove
[lincan.git] / lincan / src / setup.c
index b051d04425f776c841616462e4c4c5cf7dda664b..e36d8effd42fab93caa56a4d22b4ece0d3290644 100644 (file)
@@ -255,6 +255,10 @@ int init_device_struct(int card, int *chan_param_idx_p, int *irq_param_idx_p)
        candev->dev_base_addr=io[card];
        clock=clockfreq[card];
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10))
+       kref_init(&candev->refcount);
+#endif
+
        candev->hwspecops=(struct hwspecops_t *)can_checked_malloc(sizeof(struct hwspecops_t));
        if (candev->hwspecops==NULL)
                goto error_nomem;