]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/zeroplus-logic-cube/api.c
Simplify channel creation.
[libsigrok.git] / src / hardware / zeroplus-logic-cube / api.c
index fa6ef1dc3c76a58ea02c47fb5d3cf412dbe5d999..fd3ef08bcb325578ca66bf0fa502e9f06a4d3fce 100644 (file)
@@ -164,7 +164,6 @@ static int init(struct sr_context *sr_ctx)
 static GSList *scan(GSList *options)
 {
        struct sr_dev_inst *sdi;
-       struct sr_channel *ch;
        struct drv_context *drvc;
        struct dev_context *devc;
        const struct zp_model *prof;
@@ -247,11 +246,9 @@ static GSList *scan(GSList *options)
                // memset(devc->trigger_buffer, 0, NUM_TRIGGER_STAGES);
 
                /* Fill in channellist according to this device's profile. */
-               for (j = 0; j < devc->num_channels; j++) {
-                       ch = sr_channel_new(j, SR_CHANNEL_LOGIC, TRUE,
+               for (j = 0; j < devc->num_channels; j++)
+                       sr_channel_new(sdi, j, SR_CHANNEL_LOGIC, TRUE,
                                        channel_names[j]);
-                       sdi->channels = g_slist_append(sdi->channels, ch);
-               }
 
                devices = g_slist_append(devices, sdi);
                drvc->instances = g_slist_append(drvc->instances, sdi);