]> rtime.felk.cvut.cz Git - lincan.git/commitdiff
BKL use and local kthread implementation is obsolete for 2.6.17+ kernel.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Sun, 24 Jun 2012 19:02:44 +0000 (21:02 +0200)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Sun, 24 Jun 2012 19:02:44 +0000 (21:02 +0200)
Do not try to build obsolete file and use obsolete features.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
lincan/src/Makefile.omk
lincan/src/usbcan.c

index e9eecd6ed8c057ef5c247dbdcd9477c50126a213..0d0c203636f087ad556425d6557cdac4c7189e5a 100644 (file)
@@ -30,7 +30,8 @@ lincan_cards_SOURCES += unican_cl2.c
 endif
 
 ifeq ($(CONFIG_OC_LINCAN_CARD_ipci165),y)
 endif
 
 ifeq ($(CONFIG_OC_LINCAN_CARD_ipci165),y)
-lincan_cards_SOURCES += ipci165_fw.c kthread.c
+lincan_cards_SOURCES += ipci165_fw.c
+lincan_need_kthread=y
 endif
 
 ifeq ($(CONFIG_OC_LINCAN_CARD_sh7760),y)
 endif
 
 ifeq ($(CONFIG_OC_LINCAN_CARD_sh7760),y)
@@ -38,7 +39,11 @@ lincan_cards_SOURCES += sh7760.c
 endif
 
 ifeq ($(CONFIG_OC_LINCAN_CARD_usbcan),y)
 endif
 
 ifeq ($(CONFIG_OC_LINCAN_CARD_usbcan),y)
-lincan_cards_SOURCES += kthread.c
+lincan_need_kthread=y
+endif
+
+ifeq ($(lincan_need_kthread),y)
+#lincan_cards_SOURCES += kthread.c
 endif
 
 ifneq ($(filter hms30c7202_can ns_dev_can,$(lincan_cards_SELECTED)),)
 endif
 
 ifneq ($(filter hms30c7202_can ns_dev_can,$(lincan_cards_SELECTED)),)
index 70e0a84609f068999affc6a7e3654e9bc6d4e425..54f3dcb7bf41de21e7d2dbc996decc2c01b1738d 100644 (file)
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
  #include <linux/freezer.h>
 #endif
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
  #include <linux/freezer.h>
 #endif
-#include <linux/smp_lock.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38))
+  #include <linux/smp_lock.h>
+#endif
+#include <linux/module.h>
 
 static int usbcan_probe(struct usb_interface *interface, const struct usb_device_id *id);
 static void usbcan_disconnect(struct usb_interface *interface);
 
 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 */
        int j;
 
        /* prevent more I/O from starting */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38))
        lock_kernel();
        lock_kernel();
+#endif
 
        usbdevs = usb_get_intfdata(interface);
        if (usbdevs==NULL){
                CANMSG("USBCAN device seems to be already removed\n");
 
        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();
                unlock_kernel();
+#endif
                return;
        }
        usb_set_intfdata(interface, NULL);
                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);
        }
 
                mutex_unlock(&usbdevs->devs[j]->io_mutex);
        }
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38))
        unlock_kernel();
        unlock_kernel();
+#endif
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10))
        kref_put(&usbdevs->candev->refcount,release_device);
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10))
        kref_put(&usbdevs->candev->refcount,release_device);