The wrapper guarantees that sdi is not NULL.
struct dev_context *devc;
int ret;
struct dev_context *devc;
int ret;
- if (!(devc = sdi->priv))
- return SR_ERR_BUG;
/* Allocate memory for the FTDI context and initialize it. */
if (!(devc->ftdic = ftdi_new())) {
/* Allocate memory for the FTDI context and initialize it. */
if (!(devc->ftdic = ftdi_new())) {
if (sr_scpi_open(scpi) != SR_OK)
return SR_ERR;
if (sr_scpi_open(scpi) != SR_OK)
return SR_ERR;
sr_scpi_send(scpi, "PRESET");
sr_scpi_send(scpi, "INBUF ON");
sr_scpi_send(scpi, "PRESET");
sr_scpi_send(scpi, "INBUF ON");
drvc = di->context;
usb = sdi->conn;
drvc = di->context;
usb = sdi->conn;
-
- if (!(devc = sdi->priv)) {
- sr_err("%s: sdi->priv was NULL", __func__);
- return SR_ERR_ARG;
- }
device_count = libusb_get_device_list(drvc->sr_ctx->libusb_ctx,
&devlist);
device_count = libusb_get_device_list(drvc->sr_ctx->libusb_ctx,
&devlist);