Alan Stern wrote: > On Thu, 31 Aug 2006, Cedric Le Goater wrote: > >> - rc = kernel_thread(usu_probe_thread, (void*)type, CLONE_VM); >> + task = kthread_run(usu_probe_thread, (void*)type, "libusual_%d", type); >> + rc = PTR_ERR(task); > > This conversion is not valid unless IS_ERR(task) is true.
yes. this is silly ... a fix is bellow. > Did you actually try using your new code? compiled, booted, loaded but not as far as having hardware using it unfortunately. What kind of hardware would trigger this thread to load the correct module ? usb key ? thanks, C. Replaced kernel_thread() with kthread_run() since kernel_thread() is deprecated in drivers/modules. also removed obsolete URL in the MAINTAINERS file. Signed-off-by: Cedric Le Goater <[EMAIL PROTECTED]> Cc: Matthew Dharm <[EMAIL PROTECTED]> Cc: linux-usb-users@lists.sourceforge.net Cc: [EMAIL PROTECTED] --- MAINTAINERS | 1 - drivers/usb/storage/libusual.c | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) Index: 2.6.18-rc4-mm3/drivers/usb/storage/libusual.c =================================================================== --- 2.6.18-rc4-mm3.orig/drivers/usb/storage/libusual.c +++ 2.6.18-rc4-mm3/drivers/usb/storage/libusual.c @@ -8,6 +8,7 @@ #include <linux/usb.h> #include <linux/usb_usual.h> #include <linux/vmalloc.h> +#include <linux/kthread.h> /* */ @@ -117,7 +118,7 @@ static int usu_probe(struct usb_interfac const struct usb_device_id *id) { unsigned long type; - int rc; + struct task_struct* task; unsigned long flags; type = USB_US_TYPE(id->driver_info); @@ -132,8 +133,9 @@ static int usu_probe(struct usb_interfac 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); @@ -175,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); Index: 2.6.18-rc4-mm3/MAINTAINERS =================================================================== --- 2.6.18-rc4-mm3.orig/MAINTAINERS +++ 2.6.18-rc4-mm3/MAINTAINERS @@ -3065,7 +3065,6 @@ M: [EMAIL PROTECTED] L: linux-usb-users@lists.sourceforge.net L: [EMAIL PROTECTED] S: Maintained -W: http://www.one-eyed-alien.net/~mdharm/linux-usb/ USB OHCI DRIVER P: Roman Weissgaerber ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Linux-usb-users@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users