summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2018-01-09 12:40:13 -0500
committerSolomon Peachy <pizza@shaftnet.org>2018-01-09 12:42:00 -0500
commit201441e3ee23db8794c4786352035aa48519f7e8 (patch)
treee4cf8de7a854cd89e0aaa07c863bf070668c105b
parentc45eb6d14cef5be9718ddc8d7d8289378594305e (diff)
downloadselphy_print-201441e3ee23db8794c4786352035aa48519f7e8.tar.gz
selphy_print-201441e3ee23db8794c4786352035aa48519f7e8.tar.bz2
selphy_print-201441e3ee23db8794c4786352035aa48519f7e8.zip
common: don't issue an altsetting if not necessary.
-rw-r--r--backend_common.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/backend_common.c b/backend_common.c
index 7d6bbb6..31a5029 100644
--- a/backend_common.c
+++ b/backend_common.c
@@ -29,7 +29,7 @@
#include "backend_common.h"
-#define BACKEND_VERSION "0.74"
+#define BACKEND_VERSION "0.75"
#ifndef URI_PREFIX
#error "Must Define URI_PREFIX"
#endif
@@ -447,9 +447,11 @@ candidate:
}
/* Use the appropriate altesetting! */
- if (libusb_set_interface_alt_setting(dev, iface, altset)) {
- found = -1;
- goto abort_release;
+ if (altset != 0) {
+ if (libusb_set_interface_alt_setting(dev, iface, altset)) {
+ found = -1;
+ goto abort_release;
+ }
}
/* Query IEEE1284 info only if it's a PRINTER class */
@@ -993,9 +995,11 @@ int main (int argc, char **argv)
}
/* Use the appropriate altesetting! */
- if (libusb_set_interface_alt_setting(dev, iface, altset)) {
- found = -1;
- goto done_close;
+ if (altset != 0) {
+ if (libusb_set_interface_alt_setting(dev, iface, altset)) {
+ found = -1;
+ goto done_close;
+ }
}
if (config)