for (j = 0; keys[j]; j++) {
val = g_key_file_get_string(kf, sections[i], keys[j], NULL);
if (!strcmp(keys[j], "capturefile")) {
- sdi = sr_dev_inst_new(SR_ST_ACTIVE, NULL, NULL, NULL);
+ sdi = g_malloc0(sizeof(struct sr_dev_inst));
sdi->driver = &session_driver;
+ sdi->status = SR_ST_ACTIVE;
if (!session_driver_initialized) {
/* first device, init the driver */
session_driver_initialized = 1;
}
sr_dev_open(sdi);
sr_session_dev_add(*session, sdi);
+ (*session)->owned_devs = g_slist_append(
+ (*session)->owned_devs, sdi);
sdi->driver->config_set(SR_CONF_SESSIONFILE,
g_variant_new_string(filename), sdi, NULL);
sdi->driver->config_set(SR_CONF_CAPTUREFILE,
g_variant_new_uint64(total_channels), sdi, NULL);
for (p = 0; p < total_channels; p++) {
snprintf(channelname, SR_MAX_CHANNELNAME_LEN, "%" PRIu64, p);
- if (!(ch = sr_channel_new(p, SR_CHANNEL_LOGIC, TRUE,
- channelname)))
- return SR_ERR;
+ ch = sr_channel_new(p, SR_CHANNEL_LOGIC, TRUE,
+ channelname);
sdi->channels = g_slist_append(sdi->channels, ch);
}
} else if (!strncmp(keys[j], "probe", 5)) {