projects
/
libam7xxx.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
33a783f
)
am7xxx: print an error message when libusb_init fails
author
Antonio Ospite <ao2@ao2.it>
Wed, 10 Jun 2015 10:07:20 +0000
(12:07 +0200)
committer
Antonio Ospite <ao2@ao2.it>
Wed, 10 Jun 2015 13:17:49 +0000
(15:17 +0200)
src/am7xxx.c
patch
|
blob
|
history
diff --git
a/src/am7xxx.c
b/src/am7xxx.c
index
b4e3e54
..
94b01ac
100644
(file)
--- a/
src/am7xxx.c
+++ b/
src/am7xxx.c
@@
-1101,8
+1101,10
@@
AM7XXX_PUBLIC int am7xxx_init(am7xxx_context **ctx)
(*ctx)->log_level = AM7XXX_LOG_TRACE;
ret = libusb_init(&((*ctx)->usb_context));
(*ctx)->log_level = AM7XXX_LOG_TRACE;
ret = libusb_init(&((*ctx)->usb_context));
- if (ret < 0)
+ if (ret < 0) {
+ error(*ctx, "libusb_init failed: %s\n", libusb_error_name(ret));
goto out_free_context;
goto out_free_context;
+ }
libusb_set_debug((*ctx)->usb_context, LIBUSB_LOG_LEVEL_INFO);
libusb_set_debug((*ctx)->usb_context, LIBUSB_LOG_LEVEL_INFO);