X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Fscpi-pps%2Fapi.c;h=bd11f082ae78709fe1b36b8cec1545a28fbadfe5;hb=83d14190b95707d7201555122317185520c80bd0;hp=aa5b945a3349cee0573491709d304efa424ccdc7;hpb=7f0463840ab5d6a85daaa76850558d2b71e596cf;p=libsigrok.git diff --git a/src/hardware/scpi-pps/api.c b/src/hardware/scpi-pps/api.c index aa5b945a..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);