]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds: Fix broken channel group check in config_list().
authorMartin Ling <redacted>
Thu, 19 Mar 2015 19:22:04 +0000 (19:22 +0000)
committerMartin Ling <redacted>
Thu, 19 Mar 2015 23:01:50 +0000 (23:01 +0000)
src/hardware/rigol-ds/api.c

index d35d7b2f869500ddeb0bf6f9305a45553516d10f..a142a2d8c294455c79faba4bce13390978b7ed38 100644 (file)
@@ -818,14 +818,9 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
                return SR_ERR_ARG;
 
        /* If a channel group is specified, it must be a valid one. */
-       if (cg) {
-               for (i = 0; i < devc->model->analog_channels; i++)
-                       if (cg == devc->analog_groups[i])
-                               break;
-               if (i >= devc->model->analog_channels) {
-                       sr_err("Invalid channel group specified.");
-                       return SR_ERR;
-               }
+       if (cg && !g_slist_find(sdi->channel_groups, cg)) {
+               sr_err("Invalid channel group specified.");
+               return SR_ERR;
        }
 
        switch (key) {