]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/tondaj-sl-814/api.c
Use g_malloc0() consistently, simplify error handling.
[libsigrok.git] / src / hardware / tondaj-sl-814 / api.c
index 1b40b9f6f593d23d280517f070a7fd5bbf1d6d8d..2ea66ebf59be08f444e1d3469ca49b927c3201ee 100644 (file)
@@ -90,8 +90,7 @@ static GSList *scan(GSList *options)
        sdi->model = g_strdup("SL-814");
        devc = g_malloc0(sizeof(struct dev_context));
 
-       if (!(serial = sr_serial_dev_inst_new(conn, serialcomm)))
-               return NULL;
+       serial = sr_serial_dev_inst_new(conn, serialcomm);
 
        if (serial_open(serial, SERIAL_RDWR) != SR_OK)
                return NULL;