]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/link-mso19/api.c
Construct driver array at runtime, from an array of per-file arrays.
[libsigrok.git] / src / hardware / link-mso19 / api.c
index 46270ffeb7fed89836e65cd3d295f8f6123b33d8..aa8cb77865199427fa674d53dc6f9a43c93d8565 100644 (file)
@@ -195,10 +195,7 @@ static GSList *scan(GSList *options)
                        devc->protocol_trigger.mask[i] = 0xff;
                }
 
-               if (!(devc->serial = sr_serial_dev_inst_new(conn, serialcomm))) {
-                       g_free(devc);
-                       return devices;
-               }
+               devc->serial = sr_serial_dev_inst_new(conn, serialcomm);
 
                struct sr_dev_inst *sdi = g_malloc0(sizeof(struct sr_dev_inst));
                sdi->status = SR_ST_INACTIVE;
@@ -218,11 +215,9 @@ static GSList *scan(GSList *options)
                sdi->priv = devc;
 
                for (i = 0; i < NUM_CHANNELS; i++) {
-                       struct sr_channel *ch;
                        chtype = (i == 0) ? SR_CHANNEL_ANALOG : SR_CHANNEL_LOGIC;
-                       ch = sr_channel_new(i, chtype, TRUE,
+                       sr_channel_new(sdi, i, chtype, TRUE,
                                            mso19_channel_names[i]);
-                       sdi->channels = g_slist_append(sdi->channels, ch);
                }
 
                //Add the driver