]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/storage/libusual.c
USB: Nikon D80 unusual device patch
[linux-2.6-omap-h63xx.git] / drivers / usb / storage / libusual.c
index 2680c69a241737ec38fa3846f039f61e4440f2b2..599ad10a761b703da02f989eb51a88d0941ae0fd 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/usb.h>
 #include <linux/usb_usual.h>
 #include <linux/vmalloc.h>
+#include <linux/kthread.h>
 
 /*
  */
@@ -116,8 +117,8 @@ EXPORT_SYMBOL_GPL(usb_usual_check_type);
 static int usu_probe(struct usb_interface *intf,
                         const struct usb_device_id *id)
 {
-       int type;
-       int rc;
+       unsigned long type;
+       struct task_struct* task;
        unsigned long flags;
 
        type = USB_US_TYPE(id->driver_info);
@@ -132,8 +133,9 @@ static int usu_probe(struct usb_interface *intf,
        stat[type].fls |= USU_MOD_FL_THREAD;
        spin_unlock_irqrestore(&usu_lock, flags);
 
-       rc = kernel_thread(usu_probe_thread, (void*)type, CLONE_VM);
-       if (rc < 0) {
+       task = kthread_run(usu_probe_thread, (void*)type, "libusual_%d", type);
+       if (IS_ERR(task)) {
+               int rc = PTR_ERR(task);
                printk(KERN_WARNING "libusual: "
                    "Unable to start the thread for %s: %d\n",
                    bias_names[type], rc);
@@ -153,7 +155,6 @@ static void usu_disconnect(struct usb_interface *intf)
 }
 
 static struct usb_driver usu_driver = {
-       .owner =        THIS_MODULE,
        .name =         "libusual",
        .probe =        usu_probe,
        .disconnect =   usu_disconnect,
@@ -176,8 +177,6 @@ static int usu_probe_thread(void *arg)
        int rc;
        unsigned long flags;
 
-       daemonize("libusual_%d", type); /* "usb-storage" is kinda too long */
-
        /* A completion does not work here because it's counted. */
        down(&usu_init_notify);
        up(&usu_init_notify);