1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-30 16:34:23 +00:00

Attach the kernel driver on failure to usb init on linux.

This commit is contained in:
ckolivas 2013-09-28 23:09:26 +10:00
parent 00aa8b4ecf
commit 3ef9fa3b88

View File

@ -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," "USB init, kernel detach ifinfo %d interface %d failed,"
" err %d in use? %s", " err %d in use? %s",
ifinfo, THISIF(found, ifinfo), err, devstr); ifinfo, THISIF(found, ifinfo), err, devstr);
goto cldame; goto nokernel;
} }
} }
} }
@ -1719,7 +1719,11 @@ reldame:
libusb_release_interface(cgusb->handle, THISIF(found, ifinfo)); libusb_release_interface(cgusb->handle, THISIF(found, ifinfo));
cldame: cldame:
#ifdef LINUX
libusb_attach_kernel_driver(cgusb->handle, THISIF(found, ifinfo));
nokernel:
#endif
cg_wlock(&cgusb_fd_lock); cg_wlock(&cgusb_fd_lock);
libusb_close(cgusb->handle); libusb_close(cgusb->handle);
cgusb->handle = NULL; cgusb->handle = NULL;