]> sigrok.org Git - sigrok-cli.git/blobdiff - device.c
device: Use g_ascii_strcasecmp() for portability
[sigrok-cli.git] / device.c
index 17505e26a59e60a44b7b7e50f3db8f3630499759..df7a7ed6d8ad4de2f29cda9c4455de0188a30969 100644 (file)
--- a/device.c
+++ b/device.c
@@ -22,8 +22,6 @@
 #include "sigrok-cli.h"
 #include "config.h"
 
-extern struct sr_context *sr_ctx;
-
 static void free_drvopts(struct sr_config *src)
 {
        g_variant_unref(src->data);
@@ -44,7 +42,7 @@ GSList *device_scan(void)
        } else {
                /* No driver specified, let them all scan on their own. */
                devices = NULL;
-               drivers = sr_driver_list();
+               drivers = sr_driver_list(sr_ctx);
                for (i = 0; drivers[i]; i++) {
                        driver = drivers[i];
                        if (sr_driver_init(sr_ctx, driver) != SR_OK) {
@@ -78,7 +76,7 @@ struct sr_channel_group *select_channel_group(struct sr_dev_inst *sdi)
 
        for (l = channel_groups; l; l = l->next) {
                cg = l->data;
-               if (!strcasecmp(opt_channel_group, cg->name)) {
+               if (!g_ascii_strcasecmp(opt_channel_group, cg->name)) {
                        return cg;
                }
        }