- struct sr_dev_inst *sdi;
- struct context *ctx;
- const void *info = NULL;
-
- if (!(sdi = sr_dev_inst_get(adi->instances, dev_index))) {
- sr_err("sigma: %s: sdi was NULL", __func__);
- return NULL;
- }
-
- ctx = sdi->priv;
-
- switch (dev_info_id) {
- case SR_DI_INST:
- info = sdi;
- break;
- case SR_DI_NUM_PROBES:
- info = GINT_TO_POINTER(NUM_PROBES);
- break;
- case SR_DI_PROBE_NAMES:
- info = probe_names;
- break;
- case SR_DI_SAMPLERATES:
- info = &samplerates;
- break;
- case SR_DI_TRIGGER_TYPES:
- info = (char *)TRIGGER_TYPES;
- break;
- case SR_DI_CUR_SAMPLERATE:
- info = &ctx->cur_samplerate;
+ struct dev_context *devc;
+
+ switch (id) {
+ case SR_CONF_SAMPLERATE:
+ if (sdi) {
+ devc = sdi->priv;
+ *data = &devc->cur_samplerate;
+ } else
+ return SR_ERR;