]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/atten-pps3xxx/api.c
Simplify channel creation.
[libsigrok.git] / src / hardware / atten-pps3xxx / api.c
index b72eeb4a59107aff7b415438e23efeb0c904dd71..1eafaaff8d42fbc291396e3d2f98f0131f782984 100644 (file)
@@ -173,8 +173,7 @@ static GSList *scan(GSList *options, int modelid)
        sdi->conn = serial;
        for (i = 0; i < MAX_CHANNELS; i++) {
                snprintf(channel, 10, "CH%d", i + 1);
-               ch = sr_channel_new(i, SR_CHANNEL_ANALOG, TRUE, channel);
-               sdi->channels = g_slist_append(sdi->channels, ch);
+               ch = sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, channel);
                cg = g_malloc(sizeof(struct sr_channel_group));
                cg->name = g_strdup(channel);
                cg->channels = g_slist_append(NULL, ch);