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;