]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/chronovu-la/api.c
scpi-pps: Publish driver options.
[libsigrok.git] / src / hardware / chronovu-la / api.c
index 0a22922d4699c9e8d7d675b2751ed1655a2b0200..d65dabb6661b731efa703c4047ea8f7452eddb41 100644 (file)
@@ -120,7 +120,7 @@ static int add_device(int idx, int model, GSList **devices)
        devc->cur_samplerate = devc->prof->max_samplerate;
 
        /* Register the device with libsigrok. */
-       sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING,
+       sdi = sr_dev_inst_new(SR_ST_INITIALIZING,
                              "ChronoVu", devc->prof->modelname, NULL);
        if (!sdi) {
                sr_err("Failed to create device instance.");
@@ -142,7 +142,8 @@ static int add_device(int idx, int model, GSList **devices)
        *devices = g_slist_append(*devices, sdi);
        drvc->instances = g_slist_append(drvc->instances, sdi);
 
-       return SR_OK;
+       if (ret == SR_OK)
+               return SR_OK;
 
 err_free_dev_inst:
        sr_dev_inst_free(sdi);
@@ -210,8 +211,6 @@ static int dev_open(struct sr_dev_inst *sdi)
        struct dev_context *devc;
        int ret;
 
-       ret = SR_ERR;
-
        if (!(devc = sdi->priv))
                return SR_ERR_BUG;
 
@@ -254,7 +253,8 @@ static int dev_open(struct sr_dev_inst *sdi)
 
        sdi->status = SR_ST_ACTIVE;
 
-       return SR_OK;
+       if (ret == SR_OK)
+               return SR_OK;
 
 err_ftdi_free:
        ftdi_free(devc->ftdic); /* Close device (if open), free FTDI context. */