]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/beaglelogic/api.c
siglent-sds: Add 100s timebase (seen on e.g. SDS1202X-E).
[libsigrok.git] / src / hardware / beaglelogic / api.c
index b567c1f94c7f2a62b11faa188af4124d1c3993fb..2ad649ebad416dc1d32b883e808c9f87c62e9d24 100644 (file)
@@ -59,31 +59,18 @@ static const uint64_t samplerates[] = {
        SR_HZ(1),
 };
 
-static struct dev_context *beaglelogic_devc_alloc(void)
-{
-       struct dev_context *devc;
-
-       devc = g_malloc0(sizeof(struct dev_context));
-
-       /* Default non-zero values (if any) */
-       devc->fd = -1;
-       devc->limit_samples = (uint64_t)10000000;
-       devc->tcp_buffer = 0;
-
-       return devc;
-}
-
 static GSList *scan(struct sr_dev_driver *di, GSList *options)
 {
        GSList *l;
        struct sr_config *src;
        struct sr_dev_inst *sdi;
        struct dev_context *devc;
-       const char *conn = NULL;
+       const char *conn;
        gchar **params;
        int i, maxch;
 
        maxch = NUM_CHANNELS;
+       conn = NULL;
        for (l = options; l; l = l->next) {
                src = l->data;
                if (src->key == SR_CONF_NUM_LOGIC_CHANNELS)
@@ -94,6 +81,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        /* Probe for /dev/beaglelogic if not connecting via TCP */
        if (!conn) {
+               params = NULL;
                if (!g_file_test(BEAGLELOGIC_DEV_NODE, G_FILE_TEST_EXISTS))
                        return NULL;
        } else {
@@ -117,7 +105,12 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        sdi->model = g_strdup("BeagleLogic");
        sdi->version = g_strdup("1.0");
 
-       devc = beaglelogic_devc_alloc();
+       devc = g_malloc0(sizeof(struct dev_context));
+
+       /* Default non-zero values (if any) */
+       devc->fd = -1;
+       devc->limit_samples = (uint64_t)10000000;
+       devc->tcp_buffer = 0;
 
        if (!conn) {
                devc->beaglelogic = &beaglelogic_native_ops;