]> sigrok.org Git - libsigrok.git/blobdiff - device.c
Code drop from DreamSourceLabs first source release.
[libsigrok.git] / device.c
index a49faa8d595df9c05743adb9ec5fbce6b79898e2..cca0bcd33d5e99b8c9790a90bf7d0f9d2d323667 100644 (file)
--- a/device.c
+++ b/device.c
@@ -225,7 +225,7 @@ SR_API gboolean sr_dev_has_option(const struct sr_dev_inst *sdi, int key)
 }
 
 /** @private */
-SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int index, int status,
+SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int mode, int index, int status,
                const char *vendor, const char *model, const char *version)
 {
        struct sr_dev_inst *sdi;
@@ -236,6 +236,7 @@ SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int index, int status,
        }
 
        sdi->driver = NULL;
+    sdi->mode = mode;
        sdi->index = index;
        sdi->status = status;
        sdi->inst_type = -1;
@@ -250,6 +251,20 @@ SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int index, int status,
 }
 
 /** @private */
+SR_PRIV void sr_dev_probes_free(struct sr_dev_inst *sdi)
+{
+    struct sr_probe *probe;
+    GSList *l;
+
+    for (l = sdi->probes; l; l = l->next) {
+        probe = l->data;
+        g_free(probe->name);
+        g_free(probe);
+    }
+
+    sdi->probes = NULL;
+}
+
 SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi)
 {
        struct sr_probe *probe;