sdi = g_malloc0(sizeof(struct sr_dev_inst));
sdi->status = SR_ST_INACTIVE;
- sdi->vendor = g_strdup("SysClk");
+ sdi->vendor = g_strdup("Sysclk");
sdi->model = g_strdup(model->name);
sdi->priv = devc;
return sdi;
}
-/* Create a new device instance for a libusb device if it is a SysClk LWLA
+/* Create a new device instance for a libusb device if it is a Sysclk LWLA
* device and also matches the connection specification.
*/
static struct sr_dev_inst *dev_inst_new_matching(GSList *conn_matches,
} else {
if (conn_matches)
sr_warn("USB device %d.%d (%04x:%04x) is not a"
- " SysClk LWLA.", bus, address, vid, pid);
+ " Sysclk LWLA.", bus, address, vid, pid);
return NULL;
}
sdi = dev_inst_new(model);
/* This delay appears to be necessary for reliable operation. */
g_usleep(30 * 1000);
+ sdi->status = SR_ST_ACTIVE;
+
devc->active_fpga_config = FPGA_NOCONF;
devc->short_transfer_quirk = FALSE;
devc->state = STATE_IDLE;
break;
/* Rinse and repeat. */
+ sdi->status = SR_ST_INACTIVE;
sr_usb_close(usb);
}
if (ret != SR_OK)
sr_warn("Unable to shut down device.");
- libusb_release_interface(usb->devhdl, USB_INTERFACE);
+ if (usb->devhdl)
+ libusb_release_interface(usb->devhdl, USB_INTERFACE);
sr_usb_close(usb);
- return SR_OK;
+ return ret;
}
/* Check whether the device options contain a specific key.
(devc) ? devc->model->num_devopts : 0);
}
+ if (!devc)
+ return SR_ERR_ARG;
if (!has_devopt(devc->model, key | SR_CONF_LIST))
return SR_ERR_NA;
static struct sr_dev_driver sysclk_lwla_driver_info = {
.name = "sysclk-lwla",
- .longname = "SysClk LWLA series",
+ .longname = "Sysclk LWLA series",
.api_version = 1,
.init = std_init,
.cleanup = std_cleanup,