X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fbaylibre-acme%2Fapi.c;h=b824720ded820a5e3fd354c13ce3be833a29e934;hb=50ccb36f201bd6b2326822f585c01498fe6fd86a;hp=44169a1b830b69e8ab3ede1e902b43245766efb2;hpb=463160cbca37367ef94dfead0c64531d82b83ab8;p=libsigrok.git diff --git a/src/hardware/baylibre-acme/api.c b/src/hardware/baylibre-acme/api.c index 44169a1b..b824720d 100644 --- a/src/hardware/baylibre-acme/api.c +++ b/src/hardware/baylibre-acme/api.c @@ -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;