- struct drv_context *drvc;
- struct dev_context *devc;
- struct sr_dev_inst *sdi;
- struct sr_probe *probe;
- GSList *devices;
- int i;
-
- (void)options;
-
- drvc = di->priv;
- drvc->instances = NULL;
-
- devices = NULL;
-
- if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
- sr_err("Device context malloc failed.");
- return NULL;
- }
-
- if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, "alsa", NULL, NULL))) {
- sr_err("Failed to create device instance.");
- return NULL;
- }
-
- /* Set the samplerate to a default value for now. */
- devc->cur_samplerate = DEFAULT_SAMPLERATE;
- devc->num_probes = DEFAULT_PROBES;
-
- sdi->priv = devc;
- sdi->driver = di;
-
- for (i = 0; probe_names[i]; i++) {
- if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE,
- probe_names[i]))) {
- sr_err("Failed to create probe.");
- return NULL;
- }
- sdi->probes = g_slist_append(sdi->probes, probe);
- }
-
- drvc->instances = g_slist_append(drvc->instances, sdi);
- devices = g_slist_append(devices, sdi);
-
- return devices;