]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/arachnid-labs-re-load-pro/api.c
use common channel group allocation/release code
[libsigrok.git] / src / hardware / arachnid-labs-re-load-pro / api.c
index fb6f82727dedd9eafe515a5b27310bed96c6075d..c14c20d400d05db58c3c55b32680f91893666b8e 100644 (file)
@@ -146,9 +146,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        sdi->inst_type = SR_INST_SERIAL;
        sdi->conn = serial;
 
-       cg = g_malloc0(sizeof(struct sr_channel_group));
-       cg->name = g_strdup("1");
-       sdi->channel_groups = g_slist_append(sdi->channel_groups, cg);
+       cg = sr_channel_group_new(sdi, "1", NULL);
 
        ch = sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "V");
        cg->channels = g_slist_append(cg->channels, ch);