]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/asix-sigma/asix-sigma.c
rigol-ds: Use sr_scpi_get_bool().
[libsigrok.git] / src / hardware / asix-sigma / asix-sigma.c
index c02827461214329deae2c411d9fbe8657ff06bbe..e1355e9fb0f1240ddd20b2346910518da9b9617d 100644 (file)
@@ -325,7 +325,6 @@ static int init(struct sr_context *sr_ctx)
 static GSList *scan(GSList *options)
 {
        struct sr_dev_inst *sdi;
-       struct sr_channel *ch;
        struct drv_context *drvc;
        struct dev_context *devc;
        GSList *devices;
@@ -383,13 +382,9 @@ static GSList *scan(GSList *options)
        sdi->model = g_strdup(USB_MODEL_NAME);
        sdi->driver = di;
 
-       for (i = 0; i < ARRAY_SIZE(channel_names); i++) {
-               ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE,
+       for (i = 0; i < ARRAY_SIZE(channel_names); i++)
+               sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE,
                                    channel_names[i]);
-               if (!ch)
-                       return NULL;
-               sdi->channels = g_slist_append(sdi->channels, ch);
-       }
 
        devices = g_slist_append(devices, sdi);
        drvc->instances = g_slist_append(drvc->instances, sdi);
@@ -448,7 +443,7 @@ static int sigma_fpga_init_bitbang(struct dev_context *devc)
                if (data & (1 << 5))
                        return 0;
                /* The D6 was not asserted yet, wait a bit. */
-               usleep(10000);
+               g_usleep(10000);
        }
 
        return SR_ERR_TIMEOUT;