struct drv_context *drvc;
struct dev_context *devc;
struct sr_dev_inst *sdi;
- struct sr_channel *ch;
GSList *usb_devices, *devices, *l;
char *model;
sdi->driver = di;
sdi->inst_type = SR_INST_USB;
sdi->conn = l->data;
- if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "SPL")))
- return NULL;
- sdi->channels = g_slist_append(sdi->channels, ch);
-
- if (!(devc = g_try_malloc(sizeof(struct dev_context)))) {
- sr_dbg("Device context malloc failed.");
- return NULL;
- }
+ sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "SPL");
+ devc = g_malloc0(sizeof(struct dev_context));
sdi->priv = devc;
devc->limit_samples = 0;
/* The protocol provides no way to read the current