]> sigrok.org Git - libsigrok.git/blobdiff - hardware/chronovu-la8/api.c
cosmetics
[libsigrok.git] / hardware / chronovu-la8 / api.c
index 75f085c6bf646115fa30c7dab27c1c83284ccc66..9a512f90c786fbd930e4e0c89860a69b6cccf8e6 100644 (file)
@@ -68,7 +68,7 @@ static int clear_instances(void)
        return SR_OK;
 }
 
-static int hw_init(void)
+static int hw_init(struct sr_context *sr_ctx)
 {
        struct drv_context *drvc;
 
@@ -77,6 +77,7 @@ static int hw_init(void)
                return SR_ERR_MALLOC;
        }
 
+       drvc->sr_ctx = sr_ctx;
        di->priv = drvc;
 
        return SR_OK;
@@ -159,7 +160,7 @@ static GSList *hw_scan(GSList *options)
        sdi->priv = devc;
 
        for (i = 0; probe_names[i]; i++) {
-               if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE,
+               if (!(probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE,
                                           probe_names[i])))
                        return NULL;
                sdi->probes = g_slist_append(sdi->probes, probe);
@@ -278,10 +279,9 @@ static int hw_dev_close(struct sr_dev_inst *sdi)
 
 static int hw_cleanup(void)
 {
-       if (!di->priv) {
-               sr_err("%s: di->priv was NULL.", __func__);
-               return SR_ERR_BUG;
-       }
+       if (!di->priv)
+               /* Can get called on an unused driver, doesn't matter. */
+               return SR_OK;
 
        clear_instances();