]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/microchip-pickit2/api.c
use common channel group allocation/release code
[libsigrok.git] / src / hardware / microchip-pickit2 / api.c
index 4eb755d274d057e3eae731e378c8f815b9589e4e..d8a757283655496d10b9a2c2d26eed2c7c875694 100644 (file)
@@ -159,9 +159,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                sdi->connection_id = g_strdup(conn);
 
                /* Create the logic channels group. */
-               cg = g_malloc0(sizeof(*cg));
-               sdi->channel_groups = g_slist_append(NULL, cg);
-               cg->name = g_strdup("Logic");
+               cg = sr_channel_group_new(sdi, "Logic", NULL);
                ch_count = ARRAY_SIZE(channel_names);
                for (ch_idx = 0; ch_idx < ch_count; ch_idx++) {
                        ch = sr_channel_new(sdi, ch_idx, SR_CHANNEL_LOGIC,