diff options
-rw-r--r-- | xpp/xpp_usb.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/xpp/xpp_usb.c b/xpp/xpp_usb.c index bc8af46..1d4b20e 100644 --- a/xpp/xpp_usb.c +++ b/xpp/xpp_usb.c @@ -558,7 +558,14 @@ static int xusb_probe(struct usb_interface *interface, const struct usb_device_i INFO("New XUSB device MODEL=%s bus_type=%d\n", model_info->desc, model_info->bus_type); - if((retval = usb_reset_device(udev)) < 0) { + /* The USB stack before 2.6.10 seems to be a bit shoddy. It seems that when being called + * from the probe we may already have the lock to udev (the Usb DEVice). Thus we call + * the internal __usb_reset_device instead. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) + if((retval = __usb_reset_device(udev)) < 0) { +#else + if((retval = usb_reset_device(udev)) < 0) { +#endif ERR("usb_reset_device failed: %d\n", retval); goto probe_failed; } |