]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/scpi-pps/api.c
scpi-pps: Fix config_set checks.
[libsigrok.git] / src / hardware / scpi-pps / api.c
index 9ca71d3d01872f4d5103ac512e44cc3908273511..5b64f4b622e9b4a5f788b14a00f03f61e56bc620 100644 (file)
@@ -331,6 +331,9 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        int ret;
        const char *s;
 
+       if (!sdi)
+               return SR_ERR_ARG;
+
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
@@ -359,10 +362,6 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
                }
        } else {
                /* Channel group specified. */
-               if (!sdi)
-                       return SR_ERR_ARG;
-               if (g_slist_length(cg->channels) > 1)
-                       return SR_ERR_NA;
                ch = cg->channels->data;
                pch = ch->priv;
                switch (key) {