]> sigrok.org Git - libsigrok.git/blobdiff - hardware/chronovu-la8/api.c
sr/drivers: use sr_dev_inst instead of device index for dev_config_set()
[libsigrok.git] / hardware / chronovu-la8 / api.c
index 219cb6c85456a891daae6ab9e2f37ca596b7e1e6..4b8d9d3930a67ae51acc2beae738accad7e4c2a2 100644 (file)
@@ -330,23 +330,16 @@ static int hw_dev_status_get(int dev_index)
        return sdi->status;
 }
 
-static int hw_dev_config_set(int dev_index, int hwcap, const void *value)
+static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
+               const void *value)
 {
-       struct sr_dev_inst *sdi;
        struct context *ctx;
 
-       if (!(sdi = sr_dev_inst_get(cdi->instances, dev_index))) {
-               sr_err("la8: %s: sdi was NULL", __func__);
-               return SR_ERR_BUG;
-       }
-
        if (!(ctx = sdi->priv)) {
                sr_err("la8: %s: sdi->priv was NULL", __func__);
                return SR_ERR_BUG;
        }
 
-       sr_spew("la8: %s: dev_index %d, hwcap %d", __func__, dev_index, hwcap);
-
        switch (hwcap) {
        case SR_HWCAP_SAMPLERATE:
                if (set_samplerate(sdi, *(const uint64_t *)value) == SR_ERR) {