return 0;
}
- sdi = sr_device_instance_new(0, SR_ST_ACTIVE, "alsa", NULL, NULL);
+ sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, "alsa", NULL, NULL);
if (!sdi)
goto free_alsa;
struct alsa *alsa;
int err;
- if (!(sdi = sr_get_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_dev_inst_get(device_instances, device_index)))
return SR_ERR;
alsa = sdi->priv;
struct sr_device_instance *sdi;
struct alsa *alsa;
- if (!(sdi = sr_get_device_instance(device_instances, device_index))) {
+ if (!(sdi = sr_dev_inst_get(device_instances, device_index))) {
sr_err("alsa: %s: sdi was NULL", __func__);
return SR_ERR; /* TODO: SR_ERR_ARG? */
}
return SR_OK;
}
-static void hw_cleanup(void)
+static int hw_cleanup(void)
{
struct sr_device_instance *sdi;
- if (!(sdi = sr_get_device_instance(device_instances, 0)))
- return;
+ if (!(sdi = sr_dev_inst_get(device_instances, 0))) {
+ sr_err("alsa: %s: sdi was NULL", __func__);
+ return SR_ERR_BUG;
+ }
+
+ sr_dev_inst_free(sdi);
- g_free(sdi->priv);
- sr_device_instance_free(sdi);
+ return SR_OK;
}
static void *hw_get_device_info(int device_index, int device_info_id)
struct alsa *alsa;
void *info = NULL;
- if (!(sdi = sr_get_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_dev_inst_get(device_instances, device_index)))
return NULL;
alsa = sdi->priv;
struct sr_device_instance *sdi;
struct alsa *alsa;
- if (!(sdi = sr_get_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_dev_inst_get(device_instances, device_index)))
return SR_ERR;
alsa = sdi->priv;
int count;
int err;
- if (!(sdi = sr_get_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_dev_inst_get(device_instances, device_index)))
return SR_ERR;
alsa = sdi->priv;
return SR_OK;
}
-static void hw_stop_acquisition(int device_index, gpointer session_device_id)
+static int hw_stop_acquisition(int device_index, gpointer session_device_id)
{
/* Avoid compiler warnings. */
device_index = device_index;
session_device_id = session_device_id;
+
+ return SR_OK;
}
SR_PRIV struct sr_device_plugin alsa_plugin_info = {