From b0244954cffdf11c7a7b11a7cfbfc236eeffc9c8 Mon Sep 17 00:00:00 2001 From: tzafrir Date: Mon, 18 Dec 2006 14:05:56 +0000 Subject: r1728@boole: tzafrir | 2006-12-18 15:59:36 +0200 r1723@boole: tzafrir | 2006-12-18 15:54:04 +0200 Use the internal version (without locking) of usb_reset_device. Intended for kernel 2.6.9 and earlier. Finally full support of 2.6.8 and 2.6.9. r2937: diego | 2006-12-17 14:20:36 +0200 r2940: tzafrir | 2006-12-17 16:32:51 +0200 git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1732 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- xpp/xpp_usb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3