X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Ffx2lafw%2Fapi.c;h=dc085266d1129236d1eca0bfb3f32d76c0acd647;hb=755793e991c4d429f99254f23008bfddb89d8e00;hp=adae8045ae8233ab4f8c8d766c6c14cf0ba0d7b4;hpb=0d1c51f57f31baeb3a05f511728129351f9655fd;p=libsigrok.git diff --git a/src/hardware/fx2lafw/api.c b/src/hardware/fx2lafw/api.c index adae8045..dc085266 100644 --- a/src/hardware/fx2lafw/api.c +++ b/src/hardware/fx2lafw/api.c @@ -263,10 +263,11 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) continue; } - usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)); - libusb_close(hdl); + if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0) + continue; + prof = NULL; for (j = 0; supported_fx2[j].vid; j++) { if (des.idVendor == supported_fx2[j].vid && @@ -337,14 +338,16 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) libusb_get_device_address(devlist[i]), NULL); } else { if (ezusb_upload_firmware(drvc->sr_ctx, devlist[i], - USB_CONFIGURATION, prof->firmware) == SR_OK) + USB_CONFIGURATION, prof->firmware) == SR_OK) { /* Store when this device's FW was updated. */ devc->fw_updated = g_get_monotonic_time(); - else + } else { sr_err("Firmware upload failed for " - "device %d.%d (logical).", + "device %d.%d (logical), name %s.", libusb_get_bus_number(devlist[i]), - libusb_get_device_address(devlist[i])); + libusb_get_device_address(devlist[i]), + prof->firmware); + } sdi->inst_type = SR_INST_USB; sdi->conn = sr_usb_dev_inst_new(libusb_get_bus_number(devlist[i]), 0xff, NULL); @@ -538,6 +541,8 @@ static int config_list(uint32_t key, GVariant **data, switch (key) { case SR_CONF_SCAN_OPTIONS: case SR_CONF_DEVICE_OPTIONS: + if (cg) + return SR_ERR_NA; return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts); case SR_CONF_SAMPLERATE: if (!devc)