From: Lars-Peter Clausen Date: Sat, 28 May 2016 11:45:54 +0000 (+0200) Subject: pce-322a: Pass driver dev_close callback std_serial_dev_acquisition_stop() X-Git-Tag: libsigrok-0.5.0~357 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7d786a962d11c1ed7bca29da3979aaf8a52ef618;p=libsigrok.git pce-322a: Pass driver dev_close callback std_serial_dev_acquisition_stop() All drivers with the exception of pce-322a pass their dev_close callback to std_serial_dev_acquisition_stop(). The pce-322a passes std_serial_dev_close() which is also called from its dev_close() callback and replicates the other functionality of its dev_close() callback directly in std_serial_dev_acquisition_stop(). Refactor this to pass the dev_close callback function directly to std_serial_dev_acquisition_stop(). This makes sure that the driver is consistent with other drivers and also removes duplicated code. Signed-off-by: Lars-Peter Clausen --- diff --git a/src/hardware/pce-322a/api.c b/src/hardware/pce-322a/api.c index d03b34a7..57f49bf6 100644 --- a/src/hardware/pce-322a/api.c +++ b/src/hardware/pce-322a/api.c @@ -321,9 +321,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) static int dev_acquisition_stop(struct sr_dev_inst *sdi) { - pce_322a_disconnect(sdi); - - return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close, + return std_serial_dev_acquisition_stop(sdi, dev_close, sdi->conn, LOG_PREFIX); }