return list;
}
-static struct sr_dev_inst *dev_inst_new()
+static struct sr_dev_inst *dev_inst_new(void)
{
struct sr_dev_inst *sdi;
struct dev_context *devc;
}
/* Register the device with libsigrok. */
- sdi = sr_dev_inst_new(SR_ST_INACTIVE,
- VENDOR_NAME, MODEL_NAME, NULL);
- if (!sdi) {
- sr_err("Failed to instantiate device.");
- g_free(devc);
- return NULL;
- }
+ sdi = g_malloc0(sizeof(struct sr_dev_inst));
+ sdi->status = SR_ST_INACTIVE;
+ sdi->vendor = g_strdup(VENDOR_NAME);
+ sdi->model = g_strdup(MODEL_NAME);
/* Enable all channels to match the default channel configuration. */
devc->channel_mask = ALL_CHANNELS_MASK;
struct sr_usb_dev_inst *usb;
struct sr_config *src;
const char *conn;
- char connection_id[64];
drvc = di->priv;
conn = USB_VID_PID;
for (node = usb_devices; node != NULL; node = node->next) {
usb = node->data;
- usb_get_port_path(libusb_get_device(usb->devhdl),
- connection_id, sizeof(connection_id));
-
/* Create sigrok device instance. */
sdi = dev_inst_new();
if (!sdi) {
sdi->driver = di;
sdi->inst_type = SR_INST_USB;
sdi->conn = usb;
- sdi->connection_id = g_strdup(connection_id);
/* Register device instance with driver. */
drvc->instances = g_slist_append(drvc->instances, sdi);