]> sigrok.org Git - libsigrok.git/commit
serial: flush() after open() in the serial core.
authorWolfram Sang <redacted>
Sun, 3 May 2020 20:57:50 +0000 (22:57 +0200)
committerGerhard Sittig <redacted>
Sun, 26 Jul 2020 14:06:42 +0000 (16:06 +0200)
commitcb828f1b3e00ccd0ad23d7cb98dca4d0d4749b07
treeeedd1656fc1b13793977552055e2f3cd89804e36
parent3b13990f7d193e8276eb7da27ab9a1fb8f01ee95
serial: flush() after open() in the serial core.

Quite some drivers flush the serial port after opening it. And quite
some don't although they should. Factor this out, so serial_open() will
always flush the port. The removal in the drivers was done with this
small coccinelle script:

@@
struct sr_serial_dev_inst *serial;
@@

        serial_open(serial, ...)
        ... when != serial
-       serial_flush(serial);

and then the results and the unmatched findings of serial_flush() were
audited.

Signed-off-by: Wolfram Sang <redacted>
22 files changed:
src/hardware/agilent-dmm/api.c
src/hardware/appa-55ii/api.c
src/hardware/arachnid-labs-re-load-pro/api.c
src/hardware/atten-pps3xxx/api.c
src/hardware/center-3xx/api.c
src/hardware/conrad-digi-35-cpu/api.c
src/hardware/gmc-mh-1x-2x/api.c
src/hardware/gwinstek-gpd/api.c
src/hardware/kern-scale/api.c
src/hardware/korad-kaxxxxp/api.c
src/hardware/manson-hcs-3xxx/api.c
src/hardware/mastech-ms6514/api.c
src/hardware/mic-985xx/api.c
src/hardware/motech-lps-30x/api.c
src/hardware/norma-dmm/api.c
src/hardware/serial-dmm/api.c
src/hardware/serial-lcr/api.c
src/hardware/teleinfo/api.c
src/hardware/uni-t-ut32x/api.c
src/modbus/modbus_serial_rtu.c
src/scpi/scpi_serial.c
src/serial.c