aboutsummaryrefslogtreecommitdiffstats
path: root/scd/ccid-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'scd/ccid-driver.c')
-rw-r--r--scd/ccid-driver.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index ad1e16a12..7319ada41 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -1779,6 +1779,20 @@ ccid_open_usb_reader (const char *spec_reader_name,
#ifdef USE_NPTH
npth_unprotect ();
#endif
+ if (!(opt.compat_flags & COMPAT_CCID_NO_AUTO_DETACH))
+ {
+ rc = libusb_set_auto_detach_kernel_driver (idev, 1);
+ if (rc)
+ {
+#ifdef USE_NPTH
+ npth_protect ();
+#endif
+ DEBUGOUT_1 ("note: set_auto_detach_kernel_driver failed: %d\n", rc);
+#ifdef USE_NPTH
+ npth_unprotect ();
+#endif
+ }
+ }
rc = libusb_claim_interface (idev, ifc_no);
if (rc)
{