From 3ef9fa3b88b60bd0d123a747b4ef6e75f0cd317b Mon Sep 17 00:00:00 2001 From: ckolivas Date: Sat, 28 Sep 2013 23:09:26 +1000 Subject: [PATCH] Attach the kernel driver on failure to usb init on linux. --- usbutils.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usbutils.c b/usbutils.c index 8fff8472..7c335991 100644 --- a/usbutils.c +++ b/usbutils.c @@ -1505,7 +1505,7 @@ static int _usb_init(struct cgpu_info *cgpu, struct libusb_device *dev, struct u "USB init, kernel detach ifinfo %d interface %d failed," " err %d in use? %s", ifinfo, THISIF(found, ifinfo), err, devstr); - goto cldame; + goto nokernel; } } } @@ -1719,7 +1719,11 @@ reldame: libusb_release_interface(cgusb->handle, THISIF(found, ifinfo)); cldame: +#ifdef LINUX + libusb_attach_kernel_driver(cgusb->handle, THISIF(found, ifinfo)); +nokernel: +#endif cg_wlock(&cgusb_fd_lock); libusb_close(cgusb->handle); cgusb->handle = NULL;