]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/itech-it8500/api.c
use common channel group allocation/release code
[libsigrok.git] / src / hardware / itech-it8500 / api.c
index a720af5207aea98f414025aa983c4ed91f092e18..f6156f761de6d72bd0dc03c1099fc6161275dec8 100644 (file)
@@ -270,9 +270,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        sdi->version = g_strdup_printf("%x.%02x", fw_major, fw_minor);
        sdi->serial_num = unit_serial;
 
-       cg = g_malloc0(sizeof(*cg));
-       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, "V1");
        cg->channels = g_slist_append(cg->channels, ch);
        ch = sr_channel_new(sdi, 1, SR_CHANNEL_ANALOG, TRUE, "I1");