]> sigrok.org Git - libsigrok.git/blobdiff - hardware/zeroplus-logic-cube/zeroplus.c
libsigrok: closedev() now has a return code.
[libsigrok.git] / hardware / zeroplus-logic-cube / zeroplus.c
index 54d888b07f5a7d9a3b540336bf4b935d88c6abb9..f5b2d9e4443268956df325ccec771397dd993957 100644 (file)
@@ -370,12 +370,19 @@ static int hw_opendev(int device_index)
        return SR_OK;
 }
 
-static void hw_closedev(int device_index)
+static int hw_closedev(int device_index)
 {
        struct sr_device_instance *sdi;
 
-       if ((sdi = sr_get_device_instance(device_instances, device_index)))
-               close_device(sdi);
+       if (!(sdi = sr_get_device_instance(device_instances, device_index))) {
+               sr_err("lap-c: %s: sdi was NULL", __func__);
+               return SR_ERR; /* TODO: SR_ERR_ARG? */
+       }
+
+       /* TODO */
+       close_device(sdi);
+
+       return SR_OK;
 }
 
 static void hw_cleanup(void)
@@ -570,8 +577,8 @@ struct sr_device_plugin zeroplus_logic_cube_plugin_info = {
        .api_version = 1,
        .init = hw_init,
        .cleanup = hw_cleanup,
-       .open = hw_opendev,
-       .close = hw_closedev,
+       .opendev = hw_opendev,
+       .closedev = hw_closedev,
        .get_device_info = hw_get_device_info,
        .get_status = hw_get_status,
        .get_capabilities = hw_get_capabilities,