]> sigrok.org Git - libsigrok.git/blobdiff - device.c
demo: Rename GENMODE_DEFAULT to GENMODE_SIGROK.
[libsigrok.git] / device.c
index fc2635b59750c8bcfc52834e6c3c29321ab469d9..fea3d60bedfc235f87e59f5d5f6ba958a897892c 100644 (file)
--- a/device.c
+++ b/device.c
@@ -61,12 +61,18 @@ int sr_device_plugin_init(struct sr_device_plugin *plugin)
 
 void sr_device_close_all(void)
 {
+       int ret;
        struct sr_device *device;
 
        while (devices) {
                device = devices->data;
-               if (device->plugin && device->plugin->close)
-                       device->plugin->close(device->plugin_index);
+               if (device->plugin && device->plugin->closedev) {
+                       ret = device->plugin->closedev(device->plugin_index);
+                       if (ret != SR_OK) {
+                               sr_err("dev: %s: could not close device %d",
+                                      __func__, device->plugin_index);
+                       }
+               }
                sr_device_destroy(device);
        }
 }