]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/hameg-hmo/protocol.c
Simplify channel creation.
[libsigrok.git] / src / hardware / hameg-hmo / protocol.c
index 28c9fd611950b270efbb441d8102f7be31b4640e..783c3ebc26399f5d9211f1c92567900f07bd65f7 100644 (file)
@@ -616,9 +616,8 @@ SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi)
 
        /* Add analog channels. */
        for (i = 0; i < scope_models[model_index].analog_channels; i++) {
-               ch = sr_channel_new(i, SR_CHANNEL_ANALOG, TRUE,
+               ch = sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE,
                           (*scope_models[model_index].analog_names)[i]);
-               sdi->channels = g_slist_append(sdi->channels, ch);
 
                devc->analog_groups[i] = g_malloc0(sizeof(struct sr_channel_group));
 
@@ -643,9 +642,8 @@ SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi)
 
        /* Add digital channels. */
        for (i = 0; i < scope_models[model_index].digital_channels; i++) {
-               ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE,
+               ch = sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE,
                           (*scope_models[model_index].digital_names)[i]);
-               sdi->channels = g_slist_append(sdi->channels, ch);
 
                devc->digital_groups[i < 8 ? 0 : 1]->channels = g_slist_append(
                        devc->digital_groups[i < 8 ? 0 : 1]->channels, ch);