- GSList *plugins, *l;
- struct device_plugin *plugin;
- int num_devices, num_probes, i, probe_type;
-
- plugins = list_hwplugins();
-
- /*
- * Initialize all plugins first. Since the init() call may involve
- * a firmware upload and associated delay, we may as well get all
- * of these out of the way first.
- */
- for (l = plugins; l; l = l->next) {
- plugin = l->data;
- g_message("initializing %s plugin", plugin->name);
- num_devices = plugin->init(NULL);
- for (i = 0; i < num_devices; i++) {
- num_probes
- = (int)(unsigned long)plugin->get_device_info(i,
- DI_NUM_PROBES);
- probe_type = (int)(unsigned long)
- plugin->get_device_info(i, DI_PROBE_TYPE);
-
- if (probe_type != PROBE_TYPE_ANALOG)
- probe_type = PROBE_TYPE_LOGIC;
-
- device_new(plugin, i, num_probes, probe_type);
- }
+ struct sr_probe *probe;
+
+ if (!(probe = g_try_malloc0(sizeof(struct sr_probe)))) {
+ sr_err("hwdriver: probe malloc failed");
+ return NULL;