]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/maynuo-m97/api.c
output/csv: use intermediate time_t var, silence compiler warning
[libsigrok.git] / src / hardware / maynuo-m97 / api.c
index 54444d623c6d1484bfbe31f3da3d99d512a91c33..20a922fa215177a139587c94121693ec6bac45a0 100644 (file)
@@ -145,9 +145,7 @@ static struct sr_dev_inst *probe_device(struct sr_modbus_dev_inst *modbus)
        sdi->driver = &maynuo_m97_driver_info;
        sdi->inst_type = SR_INST_MODBUS;
 
-       cg = g_malloc0(sizeof(struct sr_channel_group));
-       cg->name = g_strdup("1");
-       sdi->channel_groups = g_slist_append(sdi->channel_groups, cg);
+       cg = sr_channel_group_new(sdi, "1", NULL);
 
        ch = sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "V1");
        cg->channels = g_slist_append(cg->channels, ch);