]> sigrok.org Git - libsigrok.git/commitdiff
hantek-dso: config_list(): Only SR_CONF_BUFFERSIZE needs sdi.
authorUwe Hermann <redacted>
Fri, 22 Nov 2013 19:03:03 +0000 (20:03 +0100)
committerUwe Hermann <redacted>
Fri, 22 Nov 2013 21:31:24 +0000 (22:31 +0100)
hardware/hantek-dso/api.c

index 5d09e80ad173b977bba63e489c65d9b5d2fa70ae..f74cefdf02ab54aac120f5851a7ef577cc3e2fcb 100644 (file)
@@ -595,10 +595,6 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        (void)probe_group;
 
-       if (!sdi)
-               return SR_ERR_ARG;
-
-       devc = sdi->priv;
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
                *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
@@ -609,6 +605,9 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                                devopts, ARRAY_SIZE(devopts), sizeof(int32_t));
                break;
        case SR_CONF_BUFFERSIZE:
+               if (!sdi)
+                       return SR_ERR_ARG;
+               devc = sdi->priv;
                *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT64,
                                devc->profile->buffersizes, 2, sizeof(uint64_t));
                break;