]> sigrok.org Git - libsigrok.git/commitdiff
Route sr_source_remove for all serial devices through a wrapper.
authorMartin Ling <redacted>
Mon, 2 Dec 2013 13:06:08 +0000 (13:06 +0000)
committerMartin Ling <redacted>
Sat, 7 Dec 2013 19:43:47 +0000 (19:43 +0000)
hardware/common/scpi_serial.c
hardware/common/serial.c
hardware/link-mso19/protocol.c
hardware/openbench-logic-sniffer/protocol.c
libsigrok-internal.h
std.c

index 5c07c43c6fb5cbae6b6a552d77b2d07898f6903d..6c5415c5daeb26ea2693359025f7706c3326b97d 100644 (file)
@@ -60,7 +60,7 @@ SR_PRIV int scpi_serial_source_remove(void *priv)
 {
        struct sr_serial_dev_inst *serial = priv;
 
-       return sr_source_remove(serial->fd);
+       return serial_source_remove(serial);
 }
 
 SR_PRIV int scpi_serial_send(void *priv, const char *command)
index a0de0de50b9f075494953eaf2b0621c503ee8099..af80356a3cc72a714627a272e0a420c1a22e28d0 100644 (file)
@@ -644,3 +644,8 @@ SR_PRIV int serial_source_add(struct sr_serial_dev_inst *serial, int events,
 {
        return sr_source_add(serial->fd, events, timeout, cb, cb_data);
 }
+
+SR_PRIV int serial_source_remove(struct sr_serial_dev_inst *serial)
+{
+       return sr_source_remove(serial->fd);
+}
index 19840efb8aa95cf96c9514abb5780c89bb522d61..fbb50054ab24f8194d6989985677212eb9184377 100644 (file)
@@ -294,7 +294,7 @@ SR_PRIV void stop_acquisition(const struct sr_dev_inst *sdi)
        struct dev_context *devc;
 
        devc = sdi->priv;
-       sr_source_remove(devc->serial->fd);
+       serial_source_remove(devc->serial);
 
        /* Terminate session */
        packet.type = SR_DF_END;
index bd9e55bffde4ac1b7f12c897b1bf989a0452d99f..09306dbef6afd87869d980788035ce748b3c4abb 100644 (file)
@@ -334,7 +334,7 @@ SR_PRIV void abort_acquisition(const struct sr_dev_inst *sdi)
        struct sr_serial_dev_inst *serial;
 
        serial = sdi->conn;
-       sr_source_remove(serial->fd);
+       serial_source_remove(serial);
 
        /* Terminate session */
        packet.type = SR_DF_END;
index e4eef91ec3b718bcef4a2041376b376011fbf844..b9b92ebb27c0f6a60c465a974b19b4a33e1bb7d9 100644 (file)
@@ -230,6 +230,7 @@ SR_PRIV int sr_serial_extract_options(GSList *options, const char **serial_devic
                                      const char **serial_options);
 SR_PRIV int serial_source_add(struct sr_serial_dev_inst *serial, int events,
                int timeout, sr_receive_data_callback_t cb, void *cb_data);
+SR_PRIV int serial_source_remove(struct sr_serial_dev_inst *serial);
 #endif
 
 /*--- hardware/common/ezusb.c -----------------------------------------------*/
diff --git a/std.c b/std.c
index ed37abeac641b02a760f6e1d46bad285772c002e..7837d35a3c32f95f0bcabbca69c1655d1b67f675 100644 (file)
--- a/std.c
+++ b/std.c
@@ -143,7 +143,7 @@ SR_PRIV int std_dev_acquisition_stop_serial(struct sr_dev_inst *sdi,
 
        sr_dbg("%sStopping acquisition.", prefix);
 
-       if ((ret = sr_source_remove(serial->fd)) < 0) {
+       if ((ret = serial_source_remove(serial)) < 0) {
                sr_err("%sFailed to remove source: %d.", prefix, ret);
                return ret;
        }