]> sigrok.org Git - libsigrok.git/commitdiff
rdtech-tc: use common code to scan conn= and serialcomm= specs
authorGerhard Sittig <redacted>
Thu, 16 Mar 2023 02:27:47 +0000 (03:27 +0100)
committerGerhard Sittig <redacted>
Thu, 16 Mar 2023 13:29:30 +0000 (14:29 +0100)
src/hardware/rdtech-tc/api.c

index 0ceff987cfcc27fbba851c5e57c1e5c57e30c31b..1d45d312137ec718eb7e5a2945bdf4563b32965c 100644 (file)
@@ -100,23 +100,12 @@ err_out:
 
 static GSList *scan(struct sr_dev_driver *di, GSList *options)
 {
-       struct sr_config *src;
        const char *conn;
        const char *serialcomm;
 
        conn = NULL;
        serialcomm = RDTECH_TC_SERIALCOMM;
-       for (GSList *l = options; l; l = l->next) {
-               src = l->data;
-               switch (src->key) {
-               case SR_CONF_CONN:
-                       conn = g_variant_get_string(src->data, NULL);
-                       break;
-               case SR_CONF_SERIALCOMM:
-                       serialcomm = g_variant_get_string(src->data, NULL);
-                       break;
-               }
-       }
+       (void)sr_serial_extract_options(options, &conn, &serialcomm);
        if (!conn)
                return NULL;