]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/arachnid-labs-re-load-pro/api.c
drivers: Add and use STD_CONFIG_LIST().
[libsigrok.git] / src / hardware / arachnid-labs-re-load-pro / api.c
index bfbdd7d477a54bd4da7daf6db7ca04192fa506a6..9c1fe532b28cda007df115a20ef7294213f730f9 100644 (file)
@@ -152,32 +152,9 @@ static int config_list(uint32_t key, GVariant **data,
 {
        GVariantBuilder gvb;
 
-       /* Always available. */
-       if (key == SR_CONF_SCAN_OPTIONS) {
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
-                       scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
-               return SR_OK;
-       }
-
-       if (key == SR_CONF_DEVICE_OPTIONS && !sdi) {
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
-                       drvopts, ARRAY_SIZE(drvopts), sizeof(uint32_t));
-               return SR_OK;
-       }
-
-       if (!sdi)
-               return SR_ERR_ARG;
-
        if (!cg) {
                /* No channel group: global options. */
-               switch (key) {
-               case SR_CONF_DEVICE_OPTIONS:
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
-                               devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
-                       break;
-               default:
-                       return SR_ERR_NA;
-               }
+               return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
        } else {
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS: