X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/7c28d4d63c2ccd9945d1b0bb11dd3caff4c382b3..a25d89aa7ffd590bb0d1e4dbaf6c79f579f26b21:/lincan/src/usbcan.c diff --git a/lincan/src/usbcan.c b/lincan/src/usbcan.c index 70e0a84..54f3dcb 100644 --- a/lincan/src/usbcan.c +++ b/lincan/src/usbcan.c @@ -14,7 +14,10 @@ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) #include #endif -#include +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + #include +#endif +#include static int usbcan_probe(struct usb_interface *interface, const struct usb_device_id *id); static void usbcan_disconnect(struct usb_interface *interface); @@ -1508,12 +1511,16 @@ static void usbcan_disconnect(struct usb_interface *interface) int j; /* prevent more I/O from starting */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) lock_kernel(); +#endif usbdevs = usb_get_intfdata(interface); if (usbdevs==NULL){ CANMSG("USBCAN device seems to be already removed\n"); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) unlock_kernel(); +#endif return; } usb_set_intfdata(interface, NULL); @@ -1526,7 +1533,9 @@ static void usbcan_disconnect(struct usb_interface *interface) mutex_unlock(&usbdevs->devs[j]->io_mutex); } +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) unlock_kernel(); +#endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)) kref_put(&usbdevs->candev->refcount,release_device);