}
sdi = g_malloc0(sizeof(struct sr_dev_inst));
- sdi->status = SR_ST_ACTIVE;
sdi->vendor = g_strdup(hw_info->manufacturer);
sdi->model = g_strdup(hw_info->model);
sdi->version = g_strdup(hw_info->firmware_version);
goto fail;
sdi = g_malloc0(sizeof(struct sr_dev_inst));
- sdi->status = SR_ST_ACTIVE;
sdi->vendor = g_strdup(hw_info->manufacturer);
sdi->model = g_strdup(hw_info->model);
sdi->version = g_strdup(hw_info->firmware_version);
if (hmo_init_device(sdi) != SR_OK)
goto fail;
- sr_scpi_close(sdi->conn);
-
- sdi->status = SR_ST_INACTIVE;
-
return sdi;
fail:
}
sdi = g_malloc0(sizeof(struct sr_dev_inst));
- sdi->status = SR_ST_ACTIVE;
sdi->vendor = g_strdup(model->series->vendor->name);
sdi->model = g_strdup(model->name);
sdi->version = g_strdup(hw_info->firmware_version);
sdi->priv = devc;
- sdi->status = SR_ST_INACTIVE;
-
- sr_scpi_close(scpi);
-
return sdi;
}
}
sdi = g_malloc0(sizeof(struct sr_dev_inst));
- sdi->status = SR_ST_INACTIVE;
sdi->vendor = g_strdup(vendor);
sdi->model = g_strdup(hw_info->model);
sdi->version = g_strdup(hw_info->firmware_version);
hw_info = NULL;
scpi_cmd(sdi, devc->device->commands, SCPI_CMD_LOCAL);
- sr_scpi_close(scpi);
return sdi;
}
goto fail;
sdi = g_malloc0(sizeof(struct sr_dev_inst));
- sdi->status = SR_ST_ACTIVE;
sdi->vendor = g_strdup(MANUFACTURER_NAME);
sdi->model = g_strdup(model_name);
sdi->version = g_strdup(hw_info->firmware_version);
if (dlm_device_init(sdi, model_index) != SR_OK)
goto fail;
- sr_scpi_close(sdi->conn);
-
- sdi->status = SR_ST_INACTIVE;
return sdi;
fail:
return NULL;
};
- if ((sdi = probe_device(scpi)))
- return sdi;
+ sdi = probe_device(scpi);
sr_scpi_close(scpi);
- sr_scpi_free(scpi);
- return NULL;
+
+ if (sdi)
+ sdi->status = SR_ST_INACTIVE;
+ else
+ sr_scpi_free(scpi);
+
+ return sdi;
}
SR_PRIV GSList *sr_scpi_scan(struct drv_context *drvc, GSList *options,