X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhp-3457a%2Fapi.c;h=195b9804f8ed081f0f820a5eebcc3dd9e213afd0;hb=093e1cba6b7bf14cfb77fa36f59b0c16e6fca7cc;hp=f9ea375932d43237429ad6f6c364b386e9446cae;hpb=c2fdcc25a47c4c8f25e3ea96ea36a674a151e839;p=libsigrok.git diff --git a/src/hardware/hp-3457a/api.c b/src/hardware/hp-3457a/api.c index f9ea3759..195b9804 100644 --- a/src/hardware/hp-3457a/api.c +++ b/src/hardware/hp-3457a/api.c @@ -37,7 +37,7 @@ static const uint32_t devopts[] = { SR_CONF_ADC_POWERLINE_CYCLES | SR_CONF_SET | SR_CONF_GET, }; -SR_PRIV struct sr_dev_driver hp_3457a_driver_info; +static struct sr_dev_driver hp_3457a_driver_info; static int create_front_channel(struct sr_dev_inst *sdi, int chan_idx) { @@ -214,9 +214,6 @@ static int dev_close(struct sr_dev_inst *sdi) { struct sr_scpi_dev_inst *scpi = sdi->conn; - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - /* Disable scan-advance (preserve relay life). */ sr_scpi_send(scpi, "SADV HOLD"); /* Switch back to auto-triggering. */ @@ -263,9 +260,6 @@ static int config_set(uint32_t key, GVariant *data, (void)cg; - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - devc = sdi->priv; ret = SR_OK; @@ -367,9 +361,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) GArray *ch_list; GSList *channels; - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - scpi = sdi->conn; devc = sdi->priv; @@ -378,7 +369,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) if (ret != SR_OK) return ret; - std_session_send_df_header(sdi, LOG_PREFIX); + std_session_send_df_header(sdi); front_selected = rear_selected = FALSE; devc->active_channels = NULL; @@ -437,7 +428,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi) return SR_OK; } -SR_PRIV struct sr_dev_driver hp_3457a_driver_info = { +static struct sr_dev_driver hp_3457a_driver_info = { .name = "hp-3457a", .longname = "HP 3457A", .api_version = 1, @@ -454,3 +445,4 @@ SR_PRIV struct sr_dev_driver hp_3457a_driver_info = { .dev_acquisition_stop = dev_acquisition_stop, .context = NULL, }; +SR_REGISTER_DEV_DRIVER(hp_3457a_driver_info);