From: Gerhard Sittig Date: Thu, 16 Mar 2023 02:27:47 +0000 (+0100) Subject: rdtech-tc: use common code to scan conn= and serialcomm= specs X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=fa801c4f1c37200f6f9c5be30b340f42a5e59c1b;p=libsigrok.git rdtech-tc: use common code to scan conn= and serialcomm= specs --- diff --git a/src/hardware/rdtech-tc/api.c b/src/hardware/rdtech-tc/api.c index 0ceff987..1d45d312 100644 --- a/src/hardware/rdtech-tc/api.c +++ b/src/hardware/rdtech-tc/api.c @@ -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;