if (!la8) {
g_warning("la8: %s: la8 was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
if (!la8->ftdic) {
g_warning("la8: %s: la8->ftdic was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
if (!buf) {
g_warning("la8: %s: buf was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
if (size < 0) {
g_warning("la8: %s: size was < 0", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
bytes_written = ftdi_write_data(la8->ftdic, buf, size);
if (!la8) {
g_warning("la8: %s: la8 was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
if (!la8->ftdic) {
g_warning("la8: %s: la8->ftdic was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
if (!buf) {
g_warning("la8: %s: buf was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
if (size <= 0) {
g_warning("la8: %s: size was <= 0", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
bytes_read = ftdi_read_data(la8->ftdic, buf, size);
if (!la8) {
g_warning("la8: %s: la8 was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
if (!la8->ftdic) {
g_warning("la8: %s: la8->ftdic was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
if ((ret = ftdi_usb_close(la8->ftdic)) < 0) {
if (!la8) {
g_warning("la8: %s: la8 was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
if (!la8->ftdic) {
g_warning("la8: %s: la8->ftdic was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
if (la8->ftdic->usb_dev) {
if (!la8) {
g_warning("la8: %s: la8 was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
if (!la8->ftdic) {
g_warning("la8: %s: la8->ftdic was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
g_debug("la8: resetting the device");
if (!(sdi = sr_get_device_instance(device_instances, device_index))) {
g_warning("la8: %s: sdi was NULL", __func__);
- return SR_ERR;
+ return SR_ERR; /* TODO: SR_ERR_ARG? */
}
if (!(la8 = sdi->priv)) {
g_warning("la8: %s: sdi->priv was NULL", __func__);
- return SR_ERR;
+ return SR_ERR; /* TODO: SR_ERR_ARG? */
}
g_debug("la8: opening device");
if (!sdi) {
g_warning("la8: %s: sdi was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
if (!(la8 = sdi->priv)) {
g_warning("la8: %s: sdi->priv was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
g_debug("la8: setting samplerate");
if (!(sdi = sr_get_device_instance(device_instances, device_index))) {
g_warning("la8: %s: sdi was NULL", __func__);
- return SR_ERR;
+ return SR_ERR; /* TODO: SR_ERR_ARG? */
}
if (!(la8 = sdi->priv)) {
g_warning("la8: %s: sdi->priv was NULL", __func__);
- return SR_ERR;
+ return SR_ERR; /* TODO: SR_ERR_ARG? */
}
switch (capability) {
if (!la8) {
g_warning("la8: %s: la8 was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
if (!la8->ftdic) {
g_warning("la8: %s: la8->ftdic was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
// g_debug("la8: %s: reading block %d", __func__, la8->block_counter);
if (!(sdi = sr_get_device_instance(device_instances, device_index))) {
g_warning("la8: %s: sdi was NULL", __func__);
- return SR_ERR;
+ return SR_ERR; /* TODO: SR_ERR_ARG? */
}
if (!(la8 = sdi->priv)) {
g_warning("la8: %s: sdi->priv was NULL", __func__);
- return SR_ERR;
+ return SR_ERR; /* TODO: SR_ERR_ARG? */
}
if (!la8->ftdic) {
g_warning("la8: %s: la8->ftdic was NULL", __func__);
- return SR_ERR;
+ return SR_ERR_ARG;
}
la8->divcount = samplerate_to_divcount(la8->cur_samplerate);