X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=src%2Fhardware%2Funi-t-dmm%2Fapi.c;h=e1580b998df3914c4f260c58370dd8f04c175ce8;hp=6feefed1b182a3afec5f0475f2a22fe494d13df1;hb=c368e6f3d248a73d69cd0c2c4a7c88a92def55e3;hpb=f57d8ffe66612a1fdc20ed09c222f8ea59bd84d4 diff --git a/src/hardware/uni-t-dmm/api.c b/src/hardware/uni-t-dmm/api.c index 6feefed1..e1580b99 100644 --- a/src/hardware/uni-t-dmm/api.c +++ b/src/hardware/uni-t-dmm/api.c @@ -252,24 +252,18 @@ static GSList *scan(GSList *options, int dmm) for (l = usb_devices; l; l = l->next) { usb = l->data; - devc = g_malloc0(sizeof(struct dev_context)); - devc->first_run = TRUE; - sdi = g_malloc0(sizeof(struct sr_dev_inst)); sdi->status = SR_ST_INACTIVE; sdi->vendor = g_strdup(udmms[dmm].vendor); sdi->model = g_strdup(udmms[dmm].device); sdi->priv = devc; sdi->driver = udmms[dmm].di; - if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1"))) - return NULL; + ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1"); sdi->channels = g_slist_append(sdi->channels, ch); - sdi->inst_type = SR_INST_USB; sdi->conn = usb; - drvc->instances = g_slist_append(drvc->instances, sdi); devices = g_slist_append(devices, sdi); }