]> sigrok.org Git - libsigrok.git/blobdiff - hardware/genericdmm/api.c
sr/drivers: use sr_dev_inst instead of device index for dev_config_set()
[libsigrok.git] / hardware / genericdmm / api.c
index 2dab4b876a89be44787f0621c83dc95640217348..f29aafd153ad3b002d902abf84ac3e1896b50deb 100644 (file)
@@ -488,23 +488,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(gdi->instances, dev_index))) {
-               sr_err("genericdmm: sdi was NULL.");
-               return SR_ERR_BUG;
-       }
-
        if (!(ctx = sdi->priv)) {
                sr_err("genericdmm: sdi->priv was NULL.");
                return SR_ERR_BUG;
        }
 
-       sr_spew("genericdmm: dev_index %d, hwcap %d.", dev_index, hwcap);
-
        switch (hwcap) {
        case SR_HWCAP_LIMIT_MSEC:
                if (*(const uint64_t *)value == 0) {