]> sigrok.org Git - libsigrok.git/blobdiff - hardware/asix-sigma/asix-sigma.c
sr/drivers: change driver dev_open/dev_close calls to use sdi
[libsigrok.git] / hardware / asix-sigma / asix-sigma.c
index 4f802cacc98593d60c7686aa3d21c4879570f749..088095acb96d9177d2d24ff0d3996ed6c93df382 100644 (file)
@@ -607,15 +607,11 @@ static int upload_firmware(int firmware_idx, struct context *ctx)
        return SR_OK;
 }
 
-static int hw_dev_open(int dev_index)
+static int hw_dev_open(struct sr_dev_inst *sdi)
 {
-       struct sr_dev_inst *sdi;
        struct context *ctx;
        int ret;
 
-       if (!(sdi = sr_dev_inst_get(adi->instances, dev_index)))
-               return SR_ERR;
-
        ctx = sdi->priv;
 
        /* Make sure it's an ASIX SIGMA. */
@@ -748,16 +744,10 @@ static int configure_probes(const struct sr_dev_inst *sdi, const GSList *probes)
        return SR_OK;
 }
 
-static int hw_dev_close(int dev_index)
+static int hw_dev_close(struct sr_dev_inst *sdi)
 {
-       struct sr_dev_inst *sdi;
        struct context *ctx;
 
-       if (!(sdi = sr_dev_inst_get(adi->instances, dev_index))) {
-               sr_err("sigma: %s: sdi was NULL", __func__);
-               return SR_ERR_BUG;
-       }
-
        if (!(ctx = sdi->priv)) {
                sr_err("sigma: %s: sdi->priv was NULL", __func__);
                return SR_ERR_BUG;