return NULL;
}
- sdi = sr_dev_inst_new();
- sdi->status = SR_ST_ACTIVE;
+ sdi = g_malloc0(sizeof(struct sr_dev_inst));
+ sdi->status = SR_ST_INACTIVE;
sdi->vendor = g_strdup(vendor);
sdi->model = g_strdup(hw_info->model);
sdi->version = g_strdup(hw_info->firmware_version);
continue;
g_snprintf(ch_name, 16, "%s%s", pci[i].prefix,
channels[ch_num].name);
- ch = sr_channel_new(ch_idx++, SR_CHANNEL_ANALOG, TRUE, ch_name);
+ ch = sr_channel_new(sdi, ch_idx++, SR_CHANNEL_ANALOG, TRUE,
+ ch_name);
pch = g_malloc0(sizeof(struct pps_channel));
pch->hw_output_idx = ch_num;
pch->hwname = channels[ch_num].name;
pch->mq = pci[i].mq;
ch->priv = pch;
- sdi->channels = g_slist_append(sdi->channels, ch);
}
}
struct sr_scpi_dev_inst *scpi;
GVariant *beeper;
- if (sdi->status != SR_ST_ACTIVE)
+ if (sdi->status != SR_ST_INACTIVE)
return SR_ERR;
scpi = sdi->conn;