X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Ffx2lafw%2Ffx2lafw.c;h=fb673d675ac784725cf7e20f78a61bdc49230a6d;hb=7ec5b54955118d8c1ee003a02c3334f1a0046457;hp=3b949940351798aed01b98c9fadd7709d654a829;hpb=c50277a6ec09fb35de3a6e0f2ae3401bc72a1526;p=libsigrok.git diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index 3b949940..fb673d67 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -118,10 +118,10 @@ static const uint64_t supported_samplerates[] = { }; static const struct sr_samplerates samplerates = { - 0, - 0, - 0, - supported_samplerates, + .low = 0, + .high = 0, + .step = 0, + .list = supported_samplerates, }; SR_PRIV struct sr_dev_driver fx2lafw_driver_info; @@ -384,17 +384,7 @@ static int clear_instances(void) static int hw_init(struct sr_context *sr_ctx) { - struct drv_context *drvc; - - if (!(drvc = g_try_malloc0(sizeof(struct drv_context)))) { - sr_err("Driver context malloc failed."); - return SR_ERR_MALLOC; - } - - drvc->sr_ctx = sr_ctx; - di->priv = drvc; - - return SR_OK; + return std_hw_init(sr_ctx, di, DRIVER_LOG_DOMAIN); } static GSList *hw_scan(GSList *options) @@ -607,9 +597,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) struct dev_context *devc; switch (id) { - case SR_DI_HWCAPS: - *data = hwcaps; - break; case SR_CONF_SAMPLERATE: if (sdi) { devc = sdi->priv; @@ -650,6 +637,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi (void)sdi; switch (key) { + case SR_CONF_DEVICE_OPTIONS: + *data = hwcaps; + break; case SR_CONF_SAMPLERATE: *data = &samplerates; break;