]> sigrok.org Git - libsigrok.git/blobdiff - hardware/chronovu-la8/chronovu-la8.c
sr: Made the dev_config_set parameter a const pointer
[libsigrok.git] / hardware / chronovu-la8 / chronovu-la8.c
index 38902908b7cdf06e3434653b47d930b24e567ea3..ad3e76010d129096cc68b32bd4a833545fb734e9 100644 (file)
@@ -400,10 +400,10 @@ static int la8_reset(struct context *ctx)
        return SR_OK;
 }
 
-static int configure_probes(struct context *ctx, GSList *probes)
+static int configure_probes(struct context *ctx, const GSList *probes)
 {
-       struct sr_probe *probe;
-       GSList *l;
+       const struct sr_probe *probe;
+       const GSList *l;
        uint8_t probe_bit;
        char *tc;
 
@@ -760,7 +760,7 @@ static const int *hw_hwcap_get_all(void)
        return hwcaps;
 }
 
-static int hw_dev_config_set(int dev_index, int hwcap, void *value)
+static int hw_dev_config_set(int dev_index, int hwcap, const void *value)
 {
        struct sr_dev_inst *sdi;
        struct context *ctx;
@@ -779,32 +779,32 @@ static int hw_dev_config_set(int dev_index, int hwcap, void *value)
 
        switch (hwcap) {
        case SR_HWCAP_SAMPLERATE:
-               if (set_samplerate(sdi, *(uint64_t *)value) == SR_ERR) {
+               if (set_samplerate(sdi, *(const uint64_t *)value) == SR_ERR) {
                        sr_err("la8: %s: setting samplerate failed.", __func__);
                        return SR_ERR;
                }
                sr_dbg("la8: SAMPLERATE = %" PRIu64, ctx->cur_samplerate);
                break;
        case SR_HWCAP_PROBECONFIG:
-               if (configure_probes(ctx, (GSList *)value) != SR_OK) {
+               if (configure_probes(ctx, (const GSList *)value) != SR_OK) {
                        sr_err("la8: %s: probe config failed.", __func__);
                        return SR_ERR;
                }
                break;
        case SR_HWCAP_LIMIT_MSEC:
-               if (*(uint64_t *)value == 0) {
+               if (*(const uint64_t *)value == 0) {
                        sr_err("la8: %s: LIMIT_MSEC can't be 0.", __func__);
                        return SR_ERR;
                }
-               ctx->limit_msec = *(uint64_t *)value;
+               ctx->limit_msec = *(const uint64_t *)value;
                sr_dbg("la8: LIMIT_MSEC = %" PRIu64, ctx->limit_msec);
                break;
        case SR_HWCAP_LIMIT_SAMPLES:
-               if (*(uint64_t *)value < MIN_NUM_SAMPLES) {
+               if (*(const uint64_t *)value < MIN_NUM_SAMPLES) {
                        sr_err("la8: %s: LIMIT_SAMPLES too small.", __func__);
                        return SR_ERR;
                }
-               ctx->limit_samples = *(uint64_t *)value;
+               ctx->limit_samples = *(const uint64_t *)value;
                sr_dbg("la8: LIMIT_SAMPLES = %" PRIu64, ctx->limit_samples);
                break;
        default: