From: Uwe Hermann Date: Wed, 2 Apr 2014 16:23:23 +0000 (+0200) Subject: chronovu-la: Show errors other than "device not found". X-Git-Tag: libsigrok-0.3.0~86 X-Git-Url: http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=cfe01d0607a65bf4e17e3a8d15e4c0f2b20fb55c chronovu-la: Show errors other than "device not found". This can be useful for the user to see, e.g. for permission related issues (device is there, but cannot be accessed). --- diff --git a/hardware/chronovu-la/api.c b/hardware/chronovu-la/api.c index d258d370..b232a10b 100644 --- a/hardware/chronovu-la/api.c +++ b/hardware/chronovu-la/api.c @@ -168,8 +168,12 @@ static GSList *scan(GSList *options) for (i = 0; i < ARRAY_SIZE(vid_pid); i++) { ret = ftdi_usb_open_desc(ftdic, vid_pid[i].vid, vid_pid[i].pid, vid_pid[i].iproduct, NULL); + /* Show errors other than "device not found". */ + if (ret < 0 && ret != -3) + sr_dbg("Error finding/opening device (%d): %s.", + ret, ftdi_get_error_string(ftdic)); if (ret < 0) - continue; /* No device found. */ + continue; /* No device found, or not usable. */ sr_dbg("Found %s device (%04x:%04x).", vid_pid[i].iproduct, vid_pid[i].vid, vid_pid[i].pid);