*/
#include <config.h>
-#include <assert.h>
#include <math.h>
#include <glib.h>
#include <glib/gstdio.h>
devc = sdi->priv;
usb = sdi->conn;
- if (sdi->status == SR_ST_ACTIVE)
- /* Device is already in use. */
- return SR_ERR;
-
device_count = libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist);
if (device_count < 0) {
sr_err("Failed to get device list: %s.",
*
* Hopefully in future it will be possible to pass the data on as-is.
*/
- assert(transfer->actual_length % (DSLOGIC_ATOMIC_BYTES * channel_count) == 0);
+ if (transfer->actual_length % (DSLOGIC_ATOMIC_BYTES * channel_count) != 0)
+ sr_err("Invalid transfer length!");
deinterleave_buffer(transfer->buffer, transfer->actual_length,
devc->deinterleave_buffer, channel_count, channel_mask);
struct libusb_transfer *transfer;
int ret;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
di = sdi->driver;
drvc = di->context;
devc = sdi->priv;