From: Soeren Apel Date: Sat, 27 Sep 2014 20:33:00 +0000 (+0200) Subject: Removal of sdi->index, step 4: fix trivial sr_dev_inst_new() calls X-Git-Tag: libsigrok-0.4.0~926 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=aed4ad0beaf64062752039a13f9a95326aa1df87;hp=f2209364737835ba78126cf7f2a707f63182f0e6 Removal of sdi->index, step 4: fix trivial sr_dev_inst_new() calls --- diff --git a/src/hardware/agilent-dmm/api.c b/src/hardware/agilent-dmm/api.c index fb40818f..e4240e62 100644 --- a/src/hardware/agilent-dmm/api.c +++ b/src/hardware/agilent-dmm/api.c @@ -137,7 +137,7 @@ static GSList *scan(GSList *options) for (i = 0; supported_agdmm[i].model; i++) { if (strcmp(supported_agdmm[i].modelname, tokens[1])) continue; - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Agilent", + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Agilent", tokens[1], tokens[3]))) return NULL; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { diff --git a/src/hardware/appa-55ii/api.c b/src/hardware/appa-55ii/api.c index b96bacfb..ab3ad790 100644 --- a/src/hardware/appa-55ii/api.c +++ b/src/hardware/appa-55ii/api.c @@ -96,7 +96,7 @@ static GSList *scan(GSList *options) sr_info("Found device on port %s.", conn); - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "APPA", "55II", NULL))) + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "APPA", "55II", NULL))) goto scan_cleanup; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { diff --git a/src/hardware/asix-sigma/asix-sigma.c b/src/hardware/asix-sigma/asix-sigma.c index 8965f685..db9f404e 100644 --- a/src/hardware/asix-sigma/asix-sigma.c +++ b/src/hardware/asix-sigma/asix-sigma.c @@ -377,7 +377,7 @@ static GSList *scan(GSList *options) devc->use_triggers = 0; /* Register SIGMA device. */ - if (!(sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, USB_VENDOR_NAME, + if (!(sdi = sr_dev_inst_new(SR_ST_INITIALIZING, USB_VENDOR_NAME, USB_MODEL_NAME, NULL))) { sr_err("%s: sdi was NULL", __func__); goto free; diff --git a/src/hardware/atten-pps3xxx/api.c b/src/hardware/atten-pps3xxx/api.c index 2e62fb80..75a1fbbd 100644 --- a/src/hardware/atten-pps3xxx/api.c +++ b/src/hardware/atten-pps3xxx/api.c @@ -161,7 +161,7 @@ static GSList *scan(GSList *options, int modelid) return NULL; } - sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Atten", model->name, NULL); + sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Atten", model->name, NULL); sdi->driver = di; sdi->inst_type = SR_INST_SERIAL; sdi->conn = serial; diff --git a/src/hardware/beaglelogic/api.c b/src/hardware/beaglelogic/api.c index 8af44d1e..9abbbefc 100644 --- a/src/hardware/beaglelogic/api.c +++ b/src/hardware/beaglelogic/api.c @@ -97,7 +97,7 @@ static GSList *scan(GSList *options) if (!g_file_test(BEAGLELOGIC_DEV_NODE, G_FILE_TEST_EXISTS)) return NULL; - sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, NULL, "BeagleLogic", "1.0"); + sdi = sr_dev_inst_new(SR_ST_INACTIVE, NULL, "BeagleLogic", "1.0"); sdi->driver = di; /* Unless explicitly specified, keep max channels to 8 only */ diff --git a/src/hardware/brymen-bm86x/api.c b/src/hardware/brymen-bm86x/api.c index d56b76ae..f2253541 100644 --- a/src/hardware/brymen-bm86x/api.c +++ b/src/hardware/brymen-bm86x/api.c @@ -73,7 +73,7 @@ static GSList *scan(GSList *options) for (l = usb_devices; l; l = l->next) { usb = l->data; - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Brymen", "BM869", NULL))) { sr_err("sr_dev_inst_new returned NULL."); return NULL; diff --git a/src/hardware/brymen-dmm/api.c b/src/hardware/brymen-dmm/api.c index 553e38b2..0a10956b 100644 --- a/src/hardware/brymen-dmm/api.c +++ b/src/hardware/brymen-dmm/api.c @@ -75,7 +75,7 @@ static GSList *brymen_scan(const char *conn, const char *serialcomm) sr_info("Found device on port %s.", conn); - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Brymen", "BM85x", NULL))) + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Brymen", "BM85x", NULL))) goto scan_cleanup; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { diff --git a/src/hardware/cem-dt-885x/api.c b/src/hardware/cem-dt-885x/api.c index 25e1ce45..70a28e58 100644 --- a/src/hardware/cem-dt-885x/api.c +++ b/src/hardware/cem-dt-885x/api.c @@ -106,7 +106,7 @@ static GSList *scan(GSList *options) while (g_get_monotonic_time() - start < MAX_SCAN_TIME) { if (serial_read_nonblocking(serial, &c, 1) == 1 && c == 0xa5) { /* Found one. */ - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "CEM", + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "CEM", "DT-885x", NULL))) return NULL; diff --git a/src/hardware/center-3xx/api.c b/src/hardware/center-3xx/api.c index 765819fa..9226c5a0 100644 --- a/src/hardware/center-3xx/api.c +++ b/src/hardware/center-3xx/api.c @@ -85,7 +85,7 @@ static GSList *center_scan(const char *conn, const char *serialcomm, int idx) sr_info("Found device on port %s.", conn); - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, center_devs[idx].vendor, + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, center_devs[idx].vendor, center_devs[idx].device, NULL))) goto scan_cleanup; diff --git a/src/hardware/chronovu-la/api.c b/src/hardware/chronovu-la/api.c index 0a22922d..594a0649 100644 --- a/src/hardware/chronovu-la/api.c +++ b/src/hardware/chronovu-la/api.c @@ -120,7 +120,7 @@ static int add_device(int idx, int model, GSList **devices) devc->cur_samplerate = devc->prof->max_samplerate; /* Register the device with libsigrok. */ - sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, + sdi = sr_dev_inst_new(SR_ST_INITIALIZING, "ChronoVu", devc->prof->modelname, NULL); if (!sdi) { sr_err("Failed to create device instance."); diff --git a/src/hardware/colead-slm/api.c b/src/hardware/colead-slm/api.c index 0f4225e5..9ea44178 100644 --- a/src/hardware/colead-slm/api.c +++ b/src/hardware/colead-slm/api.c @@ -82,7 +82,7 @@ static GSList *scan(GSList *options) if (!serialcomm) serialcomm = SERIALCOMM; - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Colead", + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Colead", "SL-5868P", NULL))) return NULL; diff --git a/src/hardware/conrad-digi-35-cpu/api.c b/src/hardware/conrad-digi-35-cpu/api.c index 95b22007..e820e253 100644 --- a/src/hardware/conrad-digi-35-cpu/api.c +++ b/src/hardware/conrad-digi-35-cpu/api.c @@ -94,7 +94,7 @@ static GSList *scan(GSList *options) sr_spew("Conrad DIGI 35 CPU assumed at %s.", conn); - if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, "Conrad", "DIGI 35 CPU", NULL))) + if (!(sdi = sr_dev_inst_new(SR_ST_ACTIVE, "Conrad", "DIGI 35 CPU", NULL))) return NULL; sdi->conn = serial; diff --git a/src/hardware/demo/demo.c b/src/hardware/demo/demo.c index a870c112..73000bc7 100644 --- a/src/hardware/demo/demo.c +++ b/src/hardware/demo/demo.c @@ -287,7 +287,7 @@ static GSList *scan(GSList *options) } devices = NULL; - sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, "Demo device", NULL, NULL); + sdi = sr_dev_inst_new(SR_ST_ACTIVE, "Demo device", NULL, NULL); if (!sdi) { sr_err("Device instance creation failed."); return NULL; diff --git a/src/hardware/fluke-dmm/api.c b/src/hardware/fluke-dmm/api.c index 74d477cb..55638e7c 100644 --- a/src/hardware/fluke-dmm/api.c +++ b/src/hardware/fluke-dmm/api.c @@ -122,7 +122,7 @@ static GSList *fluke_scan(const char *conn, const char *serialcomm) continue; /* Skip leading spaces in version number. */ for (s = 0; tokens[1][s] == ' '; s++); - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Fluke", + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Fluke", tokens[0] + 6, tokens[1] + s))) return NULL; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { diff --git a/src/hardware/fx2lafw/api.c b/src/hardware/fx2lafw/api.c index 8e28f224..522a94bf 100644 --- a/src/hardware/fx2lafw/api.c +++ b/src/hardware/fx2lafw/api.c @@ -238,7 +238,7 @@ static GSList *scan(GSList *options) if (!prof) continue; - sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, + sdi = sr_dev_inst_new(SR_ST_INITIALIZING, prof->vendor, prof->model, prof->model_version); if (!sdi) return NULL; diff --git a/src/hardware/gmc-mh-1x-2x/api.c b/src/hardware/gmc-mh-1x-2x/api.c index a67fb0a8..7c7ca88e 100644 --- a/src/hardware/gmc-mh-1x-2x/api.c +++ b/src/hardware/gmc-mh-1x-2x/api.c @@ -223,7 +223,7 @@ static GSList *scan_1x_2x_rs232(GSList *options) if (model != METRAHIT_NONE) { sr_spew("%s %s detected!", VENDOR_GMC, gmc_model_str(model)); - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR_GMC, + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR_GMC, gmc_model_str(model), NULL))) return NULL; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { @@ -303,7 +303,7 @@ static GSList *scan_2x_bd232(GSList *options) goto exit_err; } - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR_GMC, NULL, NULL))) + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR_GMC, NULL, NULL))) goto exit_err; sdi->priv = devc; @@ -354,7 +354,7 @@ static GSList *scan_2x_bd232(GSList *options) goto exit_err; } - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR_GMC, NULL, NULL))) + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR_GMC, NULL, NULL))) goto exit_err; } }; diff --git a/src/hardware/hameg-hmo/api.c b/src/hardware/hameg-hmo/api.c index 4ce1fd7f..78cdc173 100644 --- a/src/hardware/hameg-hmo/api.c +++ b/src/hardware/hameg-hmo/api.c @@ -75,7 +75,7 @@ static struct sr_dev_inst *hmo_probe_serial_device(struct sr_scpi_dev_inst *scpi if (check_manufacturer(hw_info->manufacturer) != SR_OK) goto fail; - if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, + if (!(sdi = sr_dev_inst_new(SR_ST_ACTIVE, hw_info->manufacturer, hw_info->model, hw_info->firmware_version))) { goto fail; diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c index 3ad928bd..6f158094 100644 --- a/src/hardware/hantek-dso/api.c +++ b/src/hardware/hantek-dso/api.c @@ -166,7 +166,7 @@ static struct sr_dev_inst *dso_dev_new(const struct dso_profile *prof) struct dev_context *devc; int i; - sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, + sdi = sr_dev_inst_new(SR_ST_INITIALIZING, prof->vendor, prof->model, NULL); if (!sdi) return NULL; diff --git a/src/hardware/ikalogic-scanaplus/api.c b/src/hardware/ikalogic-scanaplus/api.c index 02d5c043..95bd3c1a 100644 --- a/src/hardware/ikalogic-scanaplus/api.c +++ b/src/hardware/ikalogic-scanaplus/api.c @@ -123,7 +123,7 @@ static GSList *scan(GSList *options) } /* Register the device with libsigrok. */ - sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, + sdi = sr_dev_inst_new(SR_ST_INITIALIZING, USB_VENDOR_NAME, USB_MODEL_NAME, NULL); if (!sdi) { sr_err("Failed to create device instance."); diff --git a/src/hardware/kecheng-kc-330b/api.c b/src/hardware/kecheng-kc-330b/api.c index 0dbf198a..ee3493df 100644 --- a/src/hardware/kecheng-kc-330b/api.c +++ b/src/hardware/kecheng-kc-330b/api.c @@ -129,7 +129,7 @@ static GSList *scan(GSList *options) for (l = usb_devices; l; l = l->next) { if (scan_kecheng(l->data, &model) != SR_OK) continue; - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR, + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR, model, NULL))) return NULL; g_free(model); diff --git a/src/hardware/lascar-el-usb/protocol.c b/src/hardware/lascar-el-usb/protocol.c index 49c5cd0a..7459a1f1 100644 --- a/src/hardware/lascar-el-usb/protocol.c +++ b/src/hardware/lascar-el-usb/protocol.c @@ -323,7 +323,7 @@ static struct sr_dev_inst *lascar_identify(unsigned char *config) return NULL; } - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, LASCAR_VENDOR, + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, LASCAR_VENDOR, profile->modelname, firmware))) return NULL; sdi->driver = di; diff --git a/src/hardware/link-mso19/api.c b/src/hardware/link-mso19/api.c index 08fcb4b7..29a5952a 100644 --- a/src/hardware/link-mso19/api.c +++ b/src/hardware/link-mso19/api.c @@ -203,7 +203,7 @@ static GSList *scan(GSList *options) return devices; } - struct sr_dev_inst *sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, + struct sr_dev_inst *sdi = sr_dev_inst_new(SR_ST_INACTIVE, manufacturer, product, hwrev); if (!sdi) { diff --git a/src/hardware/manson-hcs-3xxx/api.c b/src/hardware/manson-hcs-3xxx/api.c index 58fe7e1f..b0dc2733 100644 --- a/src/hardware/manson-hcs-3xxx/api.c +++ b/src/hardware/manson-hcs-3xxx/api.c @@ -150,7 +150,7 @@ static GSList *scan(GSList *options) } /* Init device instance, etc. */ - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Manson", + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Manson", models[model_id].name, NULL))) { sr_err("Failed to create device instance."); return NULL; diff --git a/src/hardware/mic-985xx/api.c b/src/hardware/mic-985xx/api.c index fa3534c4..eb5d25d4 100644 --- a/src/hardware/mic-985xx/api.c +++ b/src/hardware/mic-985xx/api.c @@ -84,7 +84,7 @@ static GSList *mic_scan(const char *conn, const char *serialcomm, int idx) sr_info("Found device on port %s.", conn); /* TODO: Fill in version from protocol response. */ - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, mic_devs[idx].vendor, + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, mic_devs[idx].vendor, mic_devs[idx].device, NULL))) goto scan_cleanup; diff --git a/src/hardware/motech-lps-30x/api.c b/src/hardware/motech-lps-30x/api.c index f0a0fd87..79a32aa4 100644 --- a/src/hardware/motech-lps-30x/api.c +++ b/src/hardware/motech-lps-30x/api.c @@ -444,7 +444,7 @@ static GSList *do_scan(lps_modelid modelid, struct sr_dev_driver *drv, GSList *o Therefore just print an error message, but do not exit with error. */ sr_err("Failed to query for hardware version: %d %s", errno, strerror(errno)); - sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR_MOTECH, models[modelid].modelstr, verstr); + sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR_MOTECH, models[modelid].modelstr, verstr); sdi->driver = drv; sdi->inst_type = SR_INST_SERIAL; sdi->conn = serial; diff --git a/src/hardware/norma-dmm/api.c b/src/hardware/norma-dmm/api.c index e1929bd7..93c9a79d 100644 --- a/src/hardware/norma-dmm/api.c +++ b/src/hardware/norma-dmm/api.c @@ -144,7 +144,7 @@ static GSList *do_scan(struct sr_dev_driver* drv, GSList *options) auxtype = xgittoint(buf[7]); sr_spew("%s %s DMM %s detected!", get_brandstr(drv), get_typestr(auxtype, drv), buf + 9); - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, get_brandstr(drv), get_typestr(auxtype, drv), buf + 9))) return NULL; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { diff --git a/src/hardware/openbench-logic-sniffer/api.c b/src/hardware/openbench-logic-sniffer/api.c index ad1dece4..8ed13d00 100644 --- a/src/hardware/openbench-logic-sniffer/api.c +++ b/src/hardware/openbench-logic-sniffer/api.c @@ -177,7 +177,7 @@ static GSList *scan(GSList *options) } else { /* Not an OLS -- some other board that uses the sump protocol. */ sr_info("Device does not support metadata."); - sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, + sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Sump", "Logic Analyzer", "v1.0"); sdi->driver = di; for (i = 0; i < 32; i++) { diff --git a/src/hardware/openbench-logic-sniffer/protocol.c b/src/hardware/openbench-logic-sniffer/protocol.c index 1c94b7ff..a20d674b 100644 --- a/src/hardware/openbench-logic-sniffer/protocol.c +++ b/src/hardware/openbench-logic-sniffer/protocol.c @@ -145,7 +145,7 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial) GString *tmp_str, *devname, *version; guchar tmp_c; - sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, NULL, NULL, NULL); + sdi = sr_dev_inst_new(SR_ST_INACTIVE, NULL, NULL, NULL); sdi->driver = di; devc = ols_dev_new(); sdi->priv = devc; diff --git a/src/hardware/pipistrello-ols/protocol.c b/src/hardware/pipistrello-ols/protocol.c index 53ab5324..62d77e96 100644 --- a/src/hardware/pipistrello-ols/protocol.c +++ b/src/hardware/pipistrello-ols/protocol.c @@ -226,7 +226,7 @@ SR_PRIV struct sr_dev_inst *p_ols_get_metadata(uint8_t *buf, int bytes_read, str guchar tmp_c; int index, i; - sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, NULL, NULL, NULL); + sdi = sr_dev_inst_new(SR_ST_INACTIVE, NULL, NULL, NULL); sdi->driver = di; sdi->priv = devc; diff --git a/src/hardware/rigol-ds/api.c b/src/hardware/rigol-ds/api.c index e943f9b2..eb931e50 100644 --- a/src/hardware/rigol-ds/api.c +++ b/src/hardware/rigol-ds/api.c @@ -291,7 +291,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi) } } - if (!model || !(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, + if (!model || !(sdi = sr_dev_inst_new(SR_ST_ACTIVE, model->series->vendor->name, model->name, hw_info->firmware_version))) { diff --git a/src/hardware/saleae-logic16/api.c b/src/hardware/saleae-logic16/api.c index e8ce53a8..bc5a3b9a 100644 --- a/src/hardware/saleae-logic16/api.c +++ b/src/hardware/saleae-logic16/api.c @@ -198,7 +198,7 @@ static GSList *scan(GSList *options) if (des.idVendor != LOGIC16_VID || des.idProduct != LOGIC16_PID) continue; - sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, + sdi = sr_dev_inst_new(SR_ST_INITIALIZING, "Saleae", "Logic16", NULL); if (!sdi) return NULL; diff --git a/src/hardware/scpi-pps/api.c b/src/hardware/scpi-pps/api.c index aea3bd5e..bd7e6d6e 100644 --- a/src/hardware/scpi-pps/api.c +++ b/src/hardware/scpi-pps/api.c @@ -83,7 +83,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi) return NULL; } - sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, vendor, hw_info->model, + sdi = sr_dev_inst_new(SR_ST_ACTIVE, vendor, hw_info->model, hw_info->firmware_version); sdi->conn = scpi; sdi->driver = di; diff --git a/src/hardware/serial-dmm/api.c b/src/hardware/serial-dmm/api.c index 47811001..7fdfd50e 100644 --- a/src/hardware/serial-dmm/api.c +++ b/src/hardware/serial-dmm/api.c @@ -397,7 +397,7 @@ static GSList *sdmm_scan(const char *conn, const char *serialcomm, int dmm) sr_info("Found device on port %s.", conn); - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, dmms[dmm].vendor, + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, dmms[dmm].vendor, dmms[dmm].device, NULL))) goto scan_cleanup; diff --git a/src/hardware/teleinfo/api.c b/src/hardware/teleinfo/api.c index 77cd5f8d..63432f58 100644 --- a/src/hardware/teleinfo/api.c +++ b/src/hardware/teleinfo/api.c @@ -92,7 +92,7 @@ static GSList *scan(GSList *options) sr_info("Found device on port %s.", conn); - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "EDF", "Teleinfo", NULL))) + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "EDF", "Teleinfo", NULL))) goto scan_cleanup; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { diff --git a/src/hardware/tondaj-sl-814/api.c b/src/hardware/tondaj-sl-814/api.c index 75d2d353..4578c21f 100644 --- a/src/hardware/tondaj-sl-814/api.c +++ b/src/hardware/tondaj-sl-814/api.c @@ -84,7 +84,7 @@ static GSList *scan(GSList *options) if (!serialcomm) serialcomm = SERIALCOMM; - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Tondaj", + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Tondaj", "SL-814", NULL))) { sr_err("Failed to create device instance."); return NULL; diff --git a/src/hardware/uni-t-dmm/api.c b/src/hardware/uni-t-dmm/api.c index 440a7ec1..f09710e6 100644 --- a/src/hardware/uni-t-dmm/api.c +++ b/src/hardware/uni-t-dmm/api.c @@ -212,7 +212,7 @@ static GSList *scan(GSList *options, int dmm) devc->first_run = TRUE; - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, udmms[dmm].vendor, udmms[dmm].device, NULL))) { sr_err("sr_dev_inst_new returned NULL."); return NULL; diff --git a/src/hardware/uni-t-ut32x/api.c b/src/hardware/uni-t-ut32x/api.c index ab82b779..ab1618e8 100644 --- a/src/hardware/uni-t-ut32x/api.c +++ b/src/hardware/uni-t-ut32x/api.c @@ -79,7 +79,7 @@ static GSList *scan(GSList *options) /* We have a list of sr_usb_dev_inst matching the connection * string. Wrap them in sr_dev_inst and we're done. */ for (l = usb_devices; l; l = l->next) { - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR, + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR, MODEL, NULL))) return NULL; sdi->driver = di; diff --git a/src/hardware/yokogawa-dlm/api.c b/src/hardware/yokogawa-dlm/api.c index 3cf5a2be..dfecfb18 100644 --- a/src/hardware/yokogawa-dlm/api.c +++ b/src/hardware/yokogawa-dlm/api.c @@ -62,7 +62,7 @@ static struct sr_dev_inst *probe_usbtmc_device(struct sr_scpi_dev_inst *scpi) if (dlm_model_get(hw_info->model, &model_name, &model_index) != SR_OK) goto fail; - if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, MANUFACTURER_NAME, + if (!(sdi = sr_dev_inst_new(SR_ST_ACTIVE, MANUFACTURER_NAME, model_name, NULL))) goto fail; diff --git a/src/hardware/zeroplus-logic-cube/api.c b/src/hardware/zeroplus-logic-cube/api.c index 19cf862e..9789713d 100644 --- a/src/hardware/zeroplus-logic-cube/api.c +++ b/src/hardware/zeroplus-logic-cube/api.c @@ -221,7 +221,7 @@ static GSList *scan(GSList *options) sr_info("Found ZEROPLUS %s.", prof->model_name); /* Register the device with libsigrok. */ - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, + if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR_NAME, prof->model_name, NULL))) { sr_err("%s: sr_dev_inst_new failed", __func__); return NULL;