(void)cg;
devc = sdi ? sdi->priv : NULL;
+ usb = sdi ? sdi->conn : NULL;
switch (key) {
case SR_CONF_CONN:
- if (!sdi->conn)
+ if (!usb)
return SR_ERR_ARG;
- usb = sdi->conn;
*data = g_variant_new_printf("%d.%d", usb->bus, usb->address);
return SR_OK;
case SR_CONF_SAMPLERATE:
+ if (!devc)
+ return SR_ERR_ARG;
rate = devc->samplerates[devc->curr_samplerate_idx];
*data = g_variant_new_uint64(rate);
return SR_OK;
case SR_CONF_LIMIT_SAMPLES:
+ if (!devc)
+ return SR_ERR_ARG;
return sr_sw_limits_config_get(&devc->sw_limits, key, data);
case SR_CONF_CAPTURE_RATIO:
+ if (!devc)
+ return SR_ERR_ARG;
ratio = devc->captureratios[devc->curr_captureratio_idx];
*data = g_variant_new_uint64(ratio);
return SR_OK;