]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/ikalogic-scanaplus/api.c
drivers: Random SR_CONF_LIMIT_* cleanups.
[libsigrok.git] / src / hardware / ikalogic-scanaplus / api.c
index 6538dd966050d1ecad9f14e26b0d07fe3a346d6f..fe77104d300ef593d46a2b23f214910be9d1637a 100644 (file)
@@ -200,8 +200,8 @@ static int dev_close(struct sr_dev_inst *sdi)
        return scanaplus_close(devc);
 }
 
-static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
-               const struct sr_channel_group *cg)
+static int config_get(uint32_t key, GVariant **data,
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        (void)sdi;
        (void)cg;
@@ -218,8 +218,8 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
        return SR_OK;
 }
 
-static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
-               const struct sr_channel_group *cg)
+static int config_set(uint32_t key, GVariant *data,
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
 
@@ -236,13 +236,9 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
                /* Nothing to do, the ScanaPLUS samplerate is always 100MHz. */
                break;
        case SR_CONF_LIMIT_MSEC:
-               if (g_variant_get_uint64(data) == 0)
-                       return SR_ERR_ARG;
                devc->limit_msec = g_variant_get_uint64(data);
                break;
        case SR_CONF_LIMIT_SAMPLES:
-               if (g_variant_get_uint64(data) == 0)
-                       return SR_ERR_ARG;
                devc->limit_samples = g_variant_get_uint64(data);
                break;
        default:
@@ -252,8 +248,8 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
        return SR_OK;
 }
 
-static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
-               const struct sr_channel_group *cg)
+static int config_list(uint32_t key, GVariant **data,
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS: