X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhantek-dso%2Fapi.c;h=c1b18ea9ca660a52ec8b2e4113d637b3b8a1e88c;hb=19267272d39e3ff16874f538b22b407ff242e87c;hp=48beebfcadce98de9217bb6124a807c7e8881555;hpb=04069272b4ded92dd198d39d6f268a6695b24a3f;p=libsigrok.git diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c index 48beebfc..c1b18ea9 100644 --- a/src/hardware/hantek-dso/api.c +++ b/src/hardware/hantek-dso/api.c @@ -315,7 +315,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) libusb_get_device_descriptor(devlist[i], &des); - usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)); + if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0) + continue; prof = NULL; for (j = 0; dev_profiles[j].orig_vid; j++) { @@ -329,11 +330,12 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) devices = g_slist_append(devices, sdi); devc = sdi->priv; if (ezusb_upload_firmware(drvc->sr_ctx, devlist[i], - USB_CONFIGURATION, prof->firmware) == SR_OK) + USB_CONFIGURATION, prof->firmware) == SR_OK) { /* Remember when the firmware on this device was updated */ devc->fw_updated = g_get_monotonic_time(); - else - sr_err("Firmware upload failed"); + } else { + sr_err("Firmware upload failed, name %s", prof->firmware); + } /* Dummy USB address of 0xff will get overwritten later. */ sdi->conn = sr_usb_dev_inst_new( libusb_get_bus_number(devlist[i]), 0xff, NULL);