X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fikalogic-scanalogic2%2Fapi.c;h=d459210f12a0cfcfbc7682d7c6ec2a68e9b7691e;hb=a9b2283fd038a2a8c3e2dc1ede4fcc51d5e62c7c;hp=e9b7327ce5b34db3b9ce667a2d545d61249fe0ed;hpb=65340dd5df1e596f1eb3bac54db19a697c7c68ef;p=libsigrok.git diff --git a/src/hardware/ikalogic-scanalogic2/api.c b/src/hardware/ikalogic-scanalogic2/api.c index e9b7327c..d459210f 100644 --- a/src/hardware/ikalogic-scanalogic2/api.c +++ b/src/hardware/ikalogic-scanalogic2/api.c @@ -70,8 +70,6 @@ static GSList *scan(GSList *options) struct sr_usb_dev_inst *usb; struct device_info dev_info; int ret, i; - char *fw_ver_str; - char connection_id[64]; (void)options; @@ -114,38 +112,16 @@ static GSList *scan(GSList *options) continue; } - fw_ver_str = g_strdup_printf("%u.%u", dev_info.fw_ver_major, - dev_info.fw_ver_minor); - if (!fw_ver_str) { - sr_err("Firmware string malloc failed."); - sr_usb_dev_inst_free(usb); - libusb_free_transfer(devc->xfer_in); - libusb_free_transfer(devc->xfer_out); - g_free(devc); - continue; - } - - sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR_NAME, - MODEL_NAME, fw_ver_str); - g_free(fw_ver_str); - if (!sdi) { - sr_err("sr_dev_inst_new failed."); - sr_usb_dev_inst_free(usb); - libusb_free_transfer(devc->xfer_in); - libusb_free_transfer(devc->xfer_out); - g_free(devc); - continue; - } - - usb_get_port_path(libusb_get_device(usb->devhdl), - connection_id, sizeof(connection_id)); - + sdi = sr_dev_inst_new(); + sdi->status = SR_ST_INACTIVE; + sdi->vendor = g_strdup(VENDOR_NAME); + sdi->model = g_strdup(MODEL_NAME); + sdi->version = g_strdup_printf("%u.%u", dev_info.fw_ver_major, dev_info.fw_ver_minor); + sdi->serial_num = g_strdup_printf("%d", dev_info.serial); sdi->priv = devc; sdi->driver = di; sdi->inst_type = SR_INST_USB; sdi->conn = usb; - sdi->serial_num = g_strdup_printf("%d", dev_info.serial); - sdi->connection_id = g_strdup(connection_id); for (i = 0; channel_names[i]; i++) { ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE,