/* Register the device with libsigrok. */
sdi = g_malloc0(sizeof(struct sr_dev_inst));
- sdi->status = SR_ST_INITIALIZING;
+ sdi->status = SR_ST_INACTIVE;
sdi->vendor = g_strdup("ChronoVu");
sdi->model = g_strdup(devc->prof->modelname);
sdi->serial_num = g_strdup(serial_num);
*data = g_variant_new_string(str);
break;
case SR_CONF_SAMPLERATE:
- if (!sdi || !(devc = sdi->priv))
+ if (!sdi)
return SR_ERR_BUG;
+ devc = sdi->priv;
*data = g_variant_new_uint64(devc->cur_samplerate);
break;
default:
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- if (!(devc = sdi->priv))
- return SR_ERR_BUG;
+ devc = sdi->priv;
switch (key) {
case SR_CONF_SAMPLERATE: