X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fscpi-pps%2Fapi.c;h=bd11f082ae78709fe1b36b8cec1545a28fbadfe5;hb=204dd31fa1074a78fbe3bf04208776a4a3615a1c;hp=ed9fbd9db20661a0c7b472e2741c39a89f17f560;hpb=bd5f0a143eb12b9d6c341afe28b7f25feab53046;p=libsigrok.git diff --git a/src/hardware/scpi-pps/api.c b/src/hardware/scpi-pps/api.c index ed9fbd9d..bd11f082 100644 --- a/src/hardware/scpi-pps/api.c +++ b/src/hardware/scpi-pps/api.c @@ -145,8 +145,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi, for (i = 0; i < num_channel_groups; i++) { cgs = &channel_groups[i]; - cg = g_malloc0(sizeof(struct sr_channel_group)); - cg->name = g_strdup(cgs->name); + cg = sr_channel_group_new(sdi, cgs->name, NULL); for (j = 0, mask = 1; j < 64; j++, mask <<= 1) { if (cgs->channel_index_mask & mask) { for (l = sdi->channels; l; l = l->next) { @@ -167,7 +166,6 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi, pcg = g_malloc0(sizeof(struct pps_channel_group)); pcg->features = cgs->features; cg->priv = pcg; - sdi->channel_groups = g_slist_append(sdi->channel_groups, cg); } sr_scpi_hw_info_free(hw_info); @@ -254,6 +252,17 @@ static GSList *scan_scpi_pps(struct sr_dev_driver *di, GSList *options) static GSList *scan_hpib_pps(struct sr_dev_driver *di, GSList *options) { + const char *conn; + + /* + * Only scan for HP-IB devices when conn= was specified, to not + * break SCPI devices' operation. + */ + conn = NULL; + (void)sr_serial_extract_options(options, &conn, NULL); + if (!conn) + return NULL; + return sr_scpi_scan(di->context, options, probe_hpib_pps_device); }