X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fagilent-dmm%2Fapi.c;h=b5ba7ae2e9851134b9561ef9ce4d4cdd5c25a59f;hb=b0baddef5620c5783080d0e8811e668fbc2b38f5;hp=4ce966d9d67dfc722cbd3f5ea35abcc44cb4269c;hpb=c01bf34ca264b268fee2e71ab918c71d28dc3018;p=libsigrok.git diff --git a/src/hardware/agilent-dmm/api.c b/src/hardware/agilent-dmm/api.c index 4ce966d9..b5ba7ae2 100644 --- a/src/hardware/agilent-dmm/api.c +++ b/src/hardware/agilent-dmm/api.c @@ -37,7 +37,7 @@ static const uint32_t drvopts[] = { }; static const uint32_t devopts[] = { - SR_CONF_CONTINUOUS | SR_CONF_SET, + SR_CONF_CONTINUOUS, SR_CONF_LIMIT_SAMPLES | SR_CONF_SET, SR_CONF_LIMIT_MSEC | SR_CONF_SET, }; @@ -72,11 +72,6 @@ static const struct agdmm_profile supported_agdmm[] = { SR_PRIV struct sr_dev_driver agdmm_driver_info; -static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx) -{ - return std_init(sr_ctx, di, LOG_PREFIX); -} - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct sr_dev_inst *sdi; @@ -171,10 +166,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; - if (!(devc = sdi->priv)) { - sr_err("sdi->priv was NULL."); - return SR_ERR_BUG; - } + devc = sdi->priv; switch (key) { case SR_CONF_LIMIT_MSEC: @@ -243,7 +235,7 @@ SR_PRIV struct sr_dev_driver agdmm_driver_info = { .name = "agilent-dmm", .longname = "Agilent U12xx series DMMs", .api_version = 1, - .init = init, + .init = std_init, .cleanup = std_cleanup, .scan = scan, .dev_list = std_dev_list,