]> sigrok.org Git - libsigrok.git/blobdiff - hardware/zeroplus-logic-cube/zeroplus.c
sr: add new driver API call: scan()
[libsigrok.git] / hardware / zeroplus-logic-cube / zeroplus.c
index 627b937e0ab1bbf66880da1e957b682f026c01c8..ac396dede945615963a1aa917c068bae32c19cce 100644 (file)
@@ -327,7 +327,15 @@ static int configure_probes(struct sr_dev_inst *sdi, const GSList *probes)
  * API callbacks
  */
 
-static int hw_init(const char *devinfo)
+static int hw_init(void)
+{
+
+       /* Nothing to do. */
+
+       return SR_OK;
+}
+
+static int hw_scan(void)
 {
        struct sr_dev_inst *sdi;
        struct libusb_device_descriptor des;
@@ -335,9 +343,6 @@ static int hw_init(const char *devinfo)
        int ret, devcnt, i;
        struct context *ctx;
 
-       /* Avoid compiler warnings. */
-       (void)devinfo;
-
        /* Allocate memory for our private driver context. */
        if (!(ctx = g_try_malloc(sizeof(struct context)))) {
                sr_err("zp: %s: ctx malloc failed", __func__);
@@ -740,6 +745,7 @@ SR_PRIV struct sr_dev_driver zeroplus_logic_cube_driver_info = {
        .api_version = 1,
        .init = hw_init,
        .cleanup = hw_cleanup,
+       .scan = hw_scan,
        .dev_open = hw_dev_open,
        .dev_close = hw_dev_close,
        .dev_info_get = hw_dev_info_get,