fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / usb / storage / libusual.c
index 38faca7..d3fda92 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/usb.h>
 #include <linux/usb_usual.h>
 #include <linux/vmalloc.h>
+#include <linux/kthread.h>
 
 /*
  */
@@ -153,8 +154,8 @@ static int usu_probe(struct usb_interface *intf,
 
 static int usu_kick(unsigned long type)
 {
-       int rc;
        unsigned long flags;
+       struct task_struct* task;
 
        spin_lock_irqsave(&usu_lock, flags);
        if ((stat[type].fls & (USU_MOD_FL_THREAD|USU_MOD_FL_PRESENT)) != 0) {
@@ -164,8 +165,9 @@ static int usu_kick(unsigned long type)
        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);
@@ -207,8 +209,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);