]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/colead-slm/api.c
Use g_malloc0() consistently, simplify error handling.
[libsigrok.git] / src / hardware / colead-slm / api.c
index c7d36678601b485ba1f55fa6e2c847a4f455d3a2..34bebd8e6484227438d1996c80222fc1fdaebdbb 100644 (file)
@@ -87,13 +87,11 @@ static GSList *scan(GSList *options)
        sdi->vendor = g_strdup("Colead");
        sdi->model = g_strdup("SL-5868P");
        devc = g_malloc0(sizeof(struct dev_context));
-       if (!(sdi->conn = sr_serial_dev_inst_new(conn, serialcomm)))
-               return NULL;
+       sdi->conn = sr_serial_dev_inst_new(conn, serialcomm);
        sdi->inst_type = SR_INST_SERIAL;
        sdi->priv = devc;
        sdi->driver = 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);
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);