]> sigrok.org Git - libsigrok.git/blobdiff - hardware/chronovu-la8/api.c
sr_driver_scan(): Improve checks.
[libsigrok.git] / hardware / chronovu-la8 / api.c
index ddda873394d08a2fbf572be4a7f8684e4c903764..2a97440f013a21d3cf8e4cfa2ef7fa90aaae221e 100644 (file)
@@ -96,6 +96,7 @@ static GSList *hw_scan(GSList *options)
        (void)options;
 
        drvc = di->priv;
+
        devices = NULL;
 
        /* Allocate memory for our private device context. */
@@ -169,8 +170,6 @@ static GSList *hw_scan(GSList *options)
        devices = g_slist_append(devices, sdi);
        drvc->instances = g_slist_append(drvc->instances, sdi);
 
-       sr_spew("Device init successful.");
-
        /* Close device. We'll reopen it again when we need it. */
        (void) la8_close(devc); /* Log, but ignore errors. */
 
@@ -293,15 +292,7 @@ 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_DI_TRIGGER_TYPES:
-               *data = (char *)TRIGGER_TYPES;
-               sr_spew("%s: Returning trigger types: %s.", __func__,
-                       TRIGGER_TYPES);
-               break;
-       case SR_DI_CUR_SAMPLERATE:
+       case SR_CONF_SAMPLERATE:
                if (sdi) {
                        devc = sdi->priv;
                        *data = &devc->cur_samplerate;
@@ -366,10 +357,16 @@ 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:
                fill_supported_samplerates_if_needed();
                *data = &samplerates;
                break;
+       case SR_CONF_TRIGGER_TYPE:
+               *data = (char *)TRIGGER_TYPE;
+               break;
        default:
                return SR_ERR_ARG;
        }