X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fikalogic-scanaplus%2Fapi.c;h=f29e5c39ae327c24b37a4ade4047cecc4410bc98;hb=ea57157d0d2e17e418463cf8e4f25453e5b903d7;hp=5aded17b09ca2b1dc2d1a7644fd319a96ecde499;hpb=53012da658ae94b245240c8a3e115723eede4c7d;p=libsigrok.git diff --git a/src/hardware/ikalogic-scanaplus/api.c b/src/hardware/ikalogic-scanaplus/api.c index 5aded17b..f29e5c39 100644 --- a/src/hardware/ikalogic-scanaplus/api.c +++ b/src/hardware/ikalogic-scanaplus/api.c @@ -22,8 +22,6 @@ #define USB_VENDOR_ID 0x0403 #define USB_DEVICE_ID 0x6014 -#define USB_VENDOR_NAME "IKALOGIC" -#define USB_MODEL_NAME "ScanaPLUS" #define USB_IPRODUCT "SCANAPLUS" #define SAMPLE_BUF_SIZE (8 * 1024 * 1024) @@ -97,8 +95,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sdi = g_malloc0(sizeof(struct sr_dev_inst)); sdi->status = SR_ST_INACTIVE; - sdi->vendor = g_strdup(USB_VENDOR_NAME); - sdi->model = g_strdup(USB_MODEL_NAME); + sdi->vendor = g_strdup("IKALOGIC"); + sdi->model = g_strdup("ScanaPLUS"); sdi->priv = devc; for (i = 0; i < ARRAY_SIZE(channel_names); i++) @@ -202,8 +200,8 @@ static int dev_close(struct sr_dev_inst *sdi) return scanaplus_close(devc); } -static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_channel_group *cg) +static int config_get(uint32_t key, GVariant **data, + const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { (void)sdi; (void)cg; @@ -220,8 +218,8 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s return SR_OK; } -static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_channel_group *cg) +static int config_set(uint32_t key, GVariant *data, + const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { struct dev_context *devc; @@ -238,13 +236,9 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd /* Nothing to do, the ScanaPLUS samplerate is always 100MHz. */ break; case SR_CONF_LIMIT_MSEC: - if (g_variant_get_uint64(data) == 0) - return SR_ERR_ARG; devc->limit_msec = g_variant_get_uint64(data); break; case SR_CONF_LIMIT_SAMPLES: - if (g_variant_get_uint64(data) == 0) - return SR_ERR_ARG; devc->limit_samples = g_variant_get_uint64(data); break; default: @@ -254,12 +248,12 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd return SR_OK; } -static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_channel_group *cg) +static int config_list(uint32_t key, GVariant **data, + const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { switch (key) { case SR_CONF_DEVICE_OPTIONS: - return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts); + return STD_CONFIG_LIST(key, data, sdi, cg, NO_OPTS, drvopts, devopts); case SR_CONF_SAMPLERATE: *data = std_gvar_samplerates(ARRAY_AND_SIZE(samplerates)); break;