X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Ffx2lafw%2Ffx2lafw.c;h=2cf9c0f5d4883edb89eb1b23bb5d28efe9ad8400;hb=6f4b1868e8ec8c132878d8b6d558f4af054cbd91;hp=d7fdf2f52c36c433ae0d2de086cb062173fdc31e;hpb=9c4311c524cd2eea8ce2c80b1029c936769107db;p=libsigrok.git diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index d7fdf2f5..2cf9c0f5 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -143,7 +143,8 @@ static libusb_context *usb_context = NULL; SR_PRIV struct sr_dev_driver fx2lafw_driver_info; static struct sr_dev_driver *fdi = &fx2lafw_driver_info; -static int hw_dev_config_set(int dev_index, int hwcap, const void *value); +static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap, + const void *value); static int hw_dev_acquisition_stop(int dev_index, void *cb_data); /** @@ -575,7 +576,7 @@ static int hw_dev_open(int dev_index) if (ctx->cur_samplerate == 0) { /* Samplerate hasn't been set; default to the slowest one. */ - if (hw_dev_config_set(dev_index, SR_HWCAP_SAMPLERATE, + if (hw_dev_config_set(sdi, SR_HWCAP_SAMPLERATE, &supported_samplerates[0]) == SR_ERR) return SR_ERR; } @@ -666,14 +667,12 @@ static int hw_dev_status_get(int dev_index) return sdi->status; } -static int hw_dev_config_set(int dev_index, int hwcap, const void *value) +static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap, + const void *value) { - struct sr_dev_inst *sdi; struct context *ctx; int ret; - if (!(sdi = sr_dev_inst_get(fdi->instances, dev_index))) - return SR_ERR; ctx = sdi->priv; if (hwcap == SR_HWCAP_SAMPLERATE) {