]> sigrok.org Git - libsigrok.git/blobdiff - hardware/alsa/protocol.c
Rename 'struct sr_probe' to 'struct sr_channel' everywhere.
[libsigrok.git] / hardware / alsa / protocol.c
index 74326205042a48511e5a5a824152c5d058b7ca55..ff785277a5dec770ca07f3e76fc33e0453e97c38 100644 (file)
@@ -63,7 +63,7 @@ static void alsa_scan_handle_dev(GSList **devices,
        struct drv_context *drvc = NULL;
        struct sr_dev_inst *sdi = NULL;
        struct dev_context *devc = NULL;
-       struct sr_probe *probe;
+       struct sr_channel *probe;
        int ret;
        unsigned int i, offset, channels, minrate, maxrate, rate;
        uint64_t hwrates[ARRAY_SIZE(rates)];
@@ -159,7 +159,7 @@ static void alsa_scan_handle_dev(GSList **devices,
 
        for (i = 0; i < devc->num_probes; i++) {
                snprintf(p_name, sizeof(p_name), "Ch_%d", i);
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, p_name)))
+               if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, p_name)))
                        goto scan_error_cleanup;
                sdi->probes = g_slist_append(sdi->probes, probe);
        }
@@ -282,22 +282,6 @@ SR_PRIV GSList *alsa_scan(GSList *options, struct sr_dev_driver *di)
        return devices;
 }
 
-/*
- * Helper to be used with g_slist_free_full(); for properly freeing an alsa
- * dev instance.
- */
-SR_PRIV void alsa_dev_inst_clear(struct sr_dev_inst *sdi)
-{
-       struct dev_context *devc;
-
-       if (!(devc = sdi->priv))
-               return;
-
-       snd_pcm_hw_params_free(devc->hw_params);
-       g_free((void*)devc->samplerates);
-       sr_dev_inst_free(sdi);
-}
-
 /**
  * Set the samplerate of the ALSA device.
  *