Bug fix: usb_set_configuration causes problems on Linux.
Added #ifdef WIN32 around these calls.
This commit is contained in:
parent
d045d8feec
commit
345ad4ae2d
2
olimex.c
2
olimex.c
|
@ -103,11 +103,13 @@ static int open_interface(struct olimex_transport *tr,
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
if (usb_set_configuration(tr->handle, 1) < 0) {
|
||||
pr_error(__FILE__": can't set configuration 1");
|
||||
usb_close(tr->handle);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (usb_claim_interface(tr->handle, tr->int_number) < 0) {
|
||||
pr_error(__FILE__": can't claim interface");
|
||||
|
|
2
rf2500.c
2
rf2500.c
|
@ -74,11 +74,13 @@ static int open_interface(struct rf2500_transport *tr,
|
|||
"detach kernel driver");
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
if (usb_set_configuration(tr->handle, 1) < 0) {
|
||||
pr_error("rf2500: can't set configuration 1");
|
||||
usb_close(tr->handle);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (usb_claim_interface(tr->handle, tr->int_number) < 0) {
|
||||
pr_error("rf2500: can't claim interface");
|
||||
|
|
Loading…
Reference in New Issue