]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/uni-t-ut32x/api.c
serial: flush() after open() in the serial core.
[libsigrok.git] / src / hardware / uni-t-ut32x / api.c
index 21e5be7d1a8989134bff5c9ea0b7b4c1ebdabfe0..0329727fbf5385522e1527af1f4a5d3b3644a8a1 100644 (file)
@@ -90,7 +90,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        devices = NULL;
        serial = sr_serial_dev_inst_new(conn, serialcomm);
        rc = serial_open(serial, SERIAL_RDWR);
-       serial_flush(serial);
        /* Cannot query/identify the device. Successful open shall suffice. */
        serial_close(serial);
        if (rc != SR_OK) {
@@ -114,10 +113,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        }
        devices = g_slist_append(devices, sdi);
 
-       serial_close(serial);
-       if (!devices)
-               sr_serial_dev_inst_free(serial);
-
        return std_scan_complete(di, devices);
 }