]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/baylibre-acme/api.c
drivers: Random SR_CONF_LIMIT_* cleanups.
[libsigrok.git] / src / hardware / baylibre-acme / api.c
index 44169a1b830b69e8ab3ede1e902b43245766efb2..b824720ded820a5e3fd354c13ce3be833a29e934 100644 (file)
@@ -132,8 +132,7 @@ err_out:
 }
 
 static int config_get(uint32_t key, GVariant **data,
-                     const struct sr_dev_inst *sdi,
-                     const struct sr_channel_group *cg)
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
        int ret;
@@ -173,8 +172,7 @@ static int config_get(uint32_t key, GVariant **data,
 }
 
 static int config_set(uint32_t key, GVariant *data,
-                     const struct sr_dev_inst *sdi,
-                     const struct sr_channel_group *cg)
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
        uint64_t samplerate;
@@ -216,8 +214,7 @@ static int config_set(uint32_t key, GVariant *data,
 }
 
 static int config_list(uint32_t key, GVariant **data,
-                      const struct sr_dev_inst *sdi,
-                      const struct sr_channel_group *cg)
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        uint32_t devopts_cg[MAX_DEVOPTS_CG];
        int num_devopts_cg = 0;
@@ -227,7 +224,7 @@ static int config_list(uint32_t key, GVariant **data,
                case SR_CONF_DEVICE_OPTIONS:
                        return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts);
                case SR_CONF_SAMPLERATE:
-                       *data = std_gvar_samplerates_steps(samplerates, ARRAY_SIZE(samplerates));
+                       *data = std_gvar_samplerates_steps(ARRAY_AND_SIZE(samplerates));
                        break;
                default:
                        return SR_ERR_NA;
@@ -240,8 +237,7 @@ static int config_list(uint32_t key, GVariant **data,
                        if (bl_acme_probe_has_pws(cg))
                                devopts_cg[num_devopts_cg++] = HAS_POWER_OFF;
 
-                       *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
-                               devopts_cg, num_devopts_cg, sizeof(uint32_t));
+                       *data = std_gvar_array_u32(devopts_cg, num_devopts_cg);
                        break;
                default:
                        return SR_ERR_NA;