]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/center-3xx/api.c
Simplify single device list handling
[libsigrok.git] / src / hardware / center-3xx / api.c
index 6b9c0e3981caba693e5de4187dd0a24b1bd73a25..468093c42a7f920386627a2f80dcddd90e816810 100644 (file)
@@ -62,14 +62,12 @@ static GSList *center_scan(const char *conn, const char *serialcomm, int idx)
        struct sr_dev_inst *sdi;
        struct dev_context *devc;
        struct sr_serial_dev_inst *serial;
-       GSList *devices;
 
        serial = sr_serial_dev_inst_new(conn, serialcomm);
 
        if (serial_open(serial, SERIAL_RDWR) != SR_OK)
                return NULL;
 
-       devices = NULL;
        serial_flush(serial);
 
        sr_info("Found device on port %s.", conn);
@@ -86,11 +84,9 @@ static GSList *center_scan(const char *conn, const char *serialcomm, int idx)
        for (i = 0; i < center_devs[idx].num_channels; i++)
                sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, channel_names[i]);
 
-       devices = g_slist_append(devices, sdi);
-
        serial_close(serial);
 
-       return devices;
+       return g_slist_append(NULL, sdi);
 }
 
 static GSList *scan(GSList *options, int idx)