X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Ffx2lafw%2Ffx2lafw.c;h=fb673d675ac784725cf7e20f78a61bdc49230a6d;hb=c5d6f5cc1c0069a5141c5c76f7e17dd592427138;hp=b0f94c590db4e1649b444e9ce17433911780e5fc;hpb=9a6517d14b1248855cde0d88ec9519f99184cc77;p=libsigrok.git diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index b0f94c59..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)