X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fyokogawa-dlm%2Fapi.c;h=21fa1657acb7779ee461114cb422f71a35a09daa;hb=16fc7ee29ffa196d29a20fddd81234792f88b12c;hp=618c3a4e119dbc840e4c1db4727c07d58d9ec718;hpb=a93086528e5b476812e42b423f7a8a53812af6f4;p=libsigrok.git diff --git a/src/hardware/yokogawa-dlm/api.c b/src/hardware/yokogawa-dlm/api.c index 618c3a4e..21fa1657 100644 --- a/src/hardware/yokogawa-dlm/api.c +++ b/src/hardware/yokogawa-dlm/api.c @@ -18,7 +18,9 @@ * along with this program. If not, see . */ +#include #include +#include "scpi.h" #include "protocol.h" SR_PRIV struct sr_dev_driver yokogawa_dlm_driver_info; @@ -90,7 +92,6 @@ static struct sr_dev_inst *probe_usbtmc_device(struct sr_scpi_dev_inst *scpi) 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); @@ -110,9 +111,6 @@ static struct sr_dev_inst *probe_usbtmc_device(struct sr_scpi_dev_inst *scpi) if (dlm_device_init(sdi, model_index) != SR_OK) goto fail; - sr_scpi_close(sdi->conn); - - sdi->status = SR_ST_INACTIVE; return sdi; fail: @@ -127,12 +125,12 @@ fail: static GSList *scan(struct sr_dev_driver *di, GSList *options) { - return sr_scpi_scan(di->priv, options, probe_usbtmc_device); + return sr_scpi_scan(di->context, options, probe_usbtmc_device); } static GSList *dev_list(const struct sr_dev_driver *di) { - return ((struct drv_context *)(di->priv))->instances; + return ((struct drv_context *)(di->context))->instances; } static void clear_helper(void *priv) @@ -234,7 +232,6 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s if ((cg_type = check_channel_group(devc, cg)) == CG_INVALID) return SR_ERR; - ret = SR_ERR_NA; model = devc->model_config; state = devc->model_state; @@ -718,5 +715,5 @@ SR_PRIV struct sr_dev_driver yokogawa_dlm_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, };