]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Detach kernel driver
authoradam@algroup.co.uk <adam@algroup.co.uk@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Thu, 25 Jun 2009 13:30:57 +0000 (13:30 +0000)
committeradam@algroup.co.uk <adam@algroup.co.uk@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Thu, 25 Jun 2009 13:30:57 +0000 (13:30 +0000)
linux/usb.c

index 8145b64af286216068c27908fba7fd0fcbf7c8e1..6337c21ade86a4440f09cb845616cb39cf8e9fad 100644 (file)
@@ -153,6 +153,11 @@ usb_dev_handle* OpenProxmark(int verbose) {
        if (!handle)
                return NULL;
 
        if (!handle)
                return NULL;
 
+       /* detach kernel driver first */
+       ret = usb_detach_kernel_driver_np(handle, iface);
+       /* don't complain if no driver attached */
+       if (ret<0 && ret != -61 && verbose)
+               fprintf(stderr, "detach kernel driver failed: (%d) %s!\n", ret, usb_strerror());
        ret = usb_claim_interface(handle, iface);
        if (ret<0) {
                if (verbose)
        ret = usb_claim_interface(handle, iface);
        if (ret<0) {
                if (verbose)
Impressum, Datenschutz