]> sigrok.org Git - libsigrok.git/commitdiff
beaglelogic: Use std_dev_clear() instead of open-coding it
authorLars-Peter Clausen <redacted>
Fri, 29 Apr 2016 12:08:42 +0000 (14:08 +0200)
committerLars-Peter Clausen <redacted>
Tue, 3 May 2016 19:23:41 +0000 (21:23 +0200)
The beaglelogic has an open-coded version of std_dev_clear(), replace it
with std_dev_clear().

Signed-off-by: Lars-Peter Clausen <redacted>
src/hardware/beaglelogic/api.c

index 8baf6523e9adcd383712ab172d4072d43188c1d3..e729d4e2185101231ddbddefc5fbef9e84657f2e 100644 (file)
@@ -202,25 +202,7 @@ static int dev_close(struct sr_dev_inst *sdi)
 
 static int cleanup(const struct sr_dev_driver *di)
 {
-       struct drv_context *drvc;
-       struct sr_dev_inst *sdi;
-       GSList *l;
-
-       /* unused driver */
-       if (!(drvc = di->context))
-               return SR_OK;
-
-       /* Clean up the instances */
-       for (l = drvc->instances; l; l = l->next) {
-               sdi = l->data;
-               di->dev_close(sdi);
-               g_free(sdi->priv);
-               sr_dev_inst_free(sdi);
-       }
-       g_slist_free(drvc->instances);
-       drvc->instances = NULL;
-
-       return SR_OK;
+       return std_dev_clear(di, NULL);
 }
 
 static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,