X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fikalogic-scanaplus%2Fapi.c;h=d8165c7d855a33718d3d8ce676151f6c245eb9cc;hb=aac29cc192ccf82b64e77b5e6b11b411da32deed;hp=02d5c0432b088e829c420dec499113ea8a8ffc67;hpb=5827f61b641cfd326a9cf2ea534eb4f9481a8187;p=libsigrok.git diff --git a/src/hardware/ikalogic-scanaplus/api.c b/src/hardware/ikalogic-scanaplus/api.c index 02d5c043..d8165c7d 100644 --- a/src/hardware/ikalogic-scanaplus/api.c +++ b/src/hardware/ikalogic-scanaplus/api.c @@ -123,12 +123,10 @@ static GSList *scan(GSList *options) } /* Register the device with libsigrok. */ - sdi = sr_dev_inst_new(0, 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); sdi->driver = di; sdi->priv = devc; @@ -147,7 +145,6 @@ static GSList *scan(GSList *options) return devices; -err_close_ftdic: scanaplus_close(devc); err_free_ftdic: ftdi_free(devc->ftdic); /* NOT free() or g_free()! */