Commit 0e3c8c26 authored by Matthew Dharm's avatar Matthew Dharm Committed by Greg Kroah-Hartman

USB: replace kernel_thread() with kthread_run() in libusual.c

Replaced kernel_thread() with kthread_run() since kernel_thread() is
deprecated in drivers/modules.
Signed-off-by: default avatarCedric Le Goater <clg@fr.ibm.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarMatthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 997694de
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/usb.h> #include <linux/usb.h>
#include <linux/usb_usual.h> #include <linux/usb_usual.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/kthread.h>
/* /*
*/ */
...@@ -117,7 +118,7 @@ static int usu_probe(struct usb_interface *intf, ...@@ -117,7 +118,7 @@ static int usu_probe(struct usb_interface *intf,
const struct usb_device_id *id) const struct usb_device_id *id)
{ {
unsigned long type; unsigned long type;
int rc; struct task_struct* task;
unsigned long flags; unsigned long flags;
type = USB_US_TYPE(id->driver_info); type = USB_US_TYPE(id->driver_info);
...@@ -132,8 +133,9 @@ static int usu_probe(struct usb_interface *intf, ...@@ -132,8 +133,9 @@ static int usu_probe(struct usb_interface *intf,
stat[type].fls |= USU_MOD_FL_THREAD; stat[type].fls |= USU_MOD_FL_THREAD;
spin_unlock_irqrestore(&usu_lock, flags); spin_unlock_irqrestore(&usu_lock, flags);
rc = kernel_thread(usu_probe_thread, (void*)type, CLONE_VM); task = kthread_run(usu_probe_thread, (void*)type, "libusual_%d", type);
if (rc < 0) { if (IS_ERR(task)) {
int rc = PTR_ERR(task);
printk(KERN_WARNING "libusual: " printk(KERN_WARNING "libusual: "
"Unable to start the thread for %s: %d\n", "Unable to start the thread for %s: %d\n",
bias_names[type], rc); bias_names[type], rc);
...@@ -175,8 +177,6 @@ static int usu_probe_thread(void *arg) ...@@ -175,8 +177,6 @@ static int usu_probe_thread(void *arg)
int rc; int rc;
unsigned long flags; unsigned long flags;
daemonize("libusual_%d", type); /* "usb-storage" is kinda too long */
/* A completion does not work here because it's counted. */ /* A completion does not work here because it's counted. */
down(&usu_init_notify); down(&usu_init_notify);
up(&usu_init_notify); up(&usu_init_notify);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment