]> sigrok.org Git - libsigrok.git/commitdiff
zeroplus-logic-cube: use new scan API
authorBert Vermeulen <redacted>
Sat, 14 Jul 2012 10:45:07 +0000 (12:45 +0200)
committerBert Vermeulen <redacted>
Fri, 3 Aug 2012 08:27:38 +0000 (10:27 +0200)
hardware/zeroplus-logic-cube/zeroplus.c

index 162d084c26f1a6605342eceda2d621549af8f143..8e710089434254c38e2c8824acf73fe7a201d274 100644 (file)
@@ -336,14 +336,18 @@ static int hw_init(void)
        return SR_OK;
 }
 
-static int hw_scan(void)
+static GSList *hw_scan(GSList *options)
 {
        struct sr_dev_inst *sdi;
        struct libusb_device_descriptor des;
+       GSList *devices;
        libusb_device **devlist;
        int ret, devcnt, i;
        struct context *ctx;
 
+       (void)options;
+       devices = NULL;
+
        /* Allocate memory for our private driver context. */
        if (!(ctx = g_try_malloc(sizeof(struct context)))) {
                sr_err("zp: %s: ctx malloc failed", __func__);
@@ -394,6 +398,7 @@ static int hw_scan(void)
 
                        sdi->priv = ctx;
 
+                       devices = g_slist_append(devices, sdi);
                        zdi->instances = g_slist_append(zdi->instances, sdi);
                        ctx->usb = sr_usb_dev_inst_new(
                                libusb_get_bus_number(devlist[i]),
@@ -403,7 +408,7 @@ static int hw_scan(void)
        }
        libusb_free_device_list(devlist, 1);
 
-       return devcnt;
+       return devices;
 }
 
 static int hw_dev_open(int dev_index)