X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=device.c;h=fea3d60bedfc235f87e59f5d5f6ba958a897892c;hb=d1175d5f7e184dff420038a801113f1d3c8a6ee8;hp=fc2635b59750c8bcfc52834e6c3c29321ab469d9;hpb=f38bdf5678d35a1493c17a5c260fc1120d93bd93;p=libsigrok.git diff --git a/device.c b/device.c index fc2635b5..fea3d60b 100644 --- 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); } }