- sdi = sr_dev_inst_new(SR_ST_INITIALIZING,
- USB_VENDOR_NAME, USB_MODEL_NAME, NULL);
- if (!sdi) {
- sr_err("Failed to create device instance.");
- goto err_close_ftdic;
- }
+ sdi = g_malloc0(sizeof(struct sr_dev_inst));
+ sdi->status = SR_ST_INITIALIZING;
+ sdi->vendor = g_strdup(USB_VENDOR_NAME);
+ sdi->model = g_strdup(USB_MODEL_NAME);