From: Lars-Peter Clausen Date: Sat, 28 May 2016 12:13:08 +0000 (+0200) Subject: Remove unnecessary std_serial_dev_acquisition_stop() wrappers X-Git-Tag: libsigrok-0.5.0~353 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4b1a9d5d8641080bf10e269aa12a3fc17460365f;p=libsigrok.git Remove unnecessary std_serial_dev_acquisition_stop() wrappers Now that std_serial_dev_acquisition_stop() has the same signature as the sr_dev_driver dev_acquisition_stop() callback it is possible to remove the wrapper functions and use std_serial_dev_acquisition_stop() directly has the callback function. Signed-off-by: Lars-Peter Clausen --- diff --git a/src/hardware/agilent-dmm/api.c b/src/hardware/agilent-dmm/api.c index 27db6162..47e38fb2 100644 --- a/src/hardware/agilent-dmm/api.c +++ b/src/hardware/agilent-dmm/api.c @@ -208,11 +208,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - static struct sr_dev_driver agdmm_driver_info = { .name = "agilent-dmm", .longname = "Agilent U12xx series DMMs", @@ -228,7 +223,7 @@ static struct sr_dev_driver agdmm_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(agdmm_driver_info); diff --git a/src/hardware/appa-55ii/api.c b/src/hardware/appa-55ii/api.c index ca1ac401..ff0e1aed 100644 --- a/src/hardware/appa-55ii/api.c +++ b/src/hardware/appa-55ii/api.c @@ -215,11 +215,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - static struct sr_dev_driver appa_55ii_driver_info = { .name = "appa-55ii", .longname = "APPA 55II", @@ -235,7 +230,7 @@ static struct sr_dev_driver appa_55ii_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(appa_55ii_driver_info); diff --git a/src/hardware/arachnid-labs-re-load-pro/api.c b/src/hardware/arachnid-labs-re-load-pro/api.c index 49db531f..d0a74fa7 100644 --- a/src/hardware/arachnid-labs-re-load-pro/api.c +++ b/src/hardware/arachnid-labs-re-load-pro/api.c @@ -335,11 +335,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - static struct sr_dev_driver arachnid_labs_re_load_pro_driver_info = { .name = "arachnid-labs-re-load-pro", .longname = "Arachnid Labs Re:load Pro", @@ -354,7 +349,7 @@ static struct sr_dev_driver arachnid_labs_re_load_pro_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(arachnid_labs_re_load_pro_driver_info); diff --git a/src/hardware/brymen-dmm/api.c b/src/hardware/brymen-dmm/api.c index d4825362..00ff6cf1 100644 --- a/src/hardware/brymen-dmm/api.c +++ b/src/hardware/brymen-dmm/api.c @@ -176,11 +176,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - static struct sr_dev_driver brymen_bm857_driver_info = { .name = "brymen-bm857", .longname = "Brymen BM857", @@ -196,7 +191,7 @@ static struct sr_dev_driver brymen_bm857_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(brymen_bm857_driver_info); diff --git a/src/hardware/cem-dt-885x/api.c b/src/hardware/cem-dt-885x/api.c index 8c649c85..5b8bb94c 100644 --- a/src/hardware/cem-dt-885x/api.c +++ b/src/hardware/cem-dt-885x/api.c @@ -364,14 +364,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - - return std_serial_dev_acquisition_stop(sdi); -} - static struct sr_dev_driver cem_dt_885x_driver_info = { .name = "cem-dt-885x", .longname = "CEM DT-885x", @@ -387,7 +379,7 @@ static struct sr_dev_driver cem_dt_885x_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(cem_dt_885x_driver_info); diff --git a/src/hardware/center-3xx/api.c b/src/hardware/center-3xx/api.c index c503da66..70a14699 100644 --- a/src/hardware/center-3xx/api.c +++ b/src/hardware/center-3xx/api.c @@ -183,11 +183,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, int idx) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - /* Driver-specific API function wrappers */ #define HW_SCAN(X) \ static GSList *scan_##X(struct sr_dev_driver *d, GSList *options) { \ @@ -214,7 +209,7 @@ static struct sr_dev_driver ID##_driver_info = { \ .dev_open = std_serial_dev_open, \ .dev_close = std_serial_dev_close, \ .dev_acquisition_start = dev_acquisition_start_##ID_UPPER, \ - .dev_acquisition_stop = dev_acquisition_stop, \ + .dev_acquisition_stop = std_serial_dev_acquisition_stop, \ .context = NULL, \ }; \ SR_REGISTER_DEV_DRIVER(ID##_driver_info); diff --git a/src/hardware/colead-slm/api.c b/src/hardware/colead-slm/api.c index 3bfa91a1..762cda19 100644 --- a/src/hardware/colead-slm/api.c +++ b/src/hardware/colead-slm/api.c @@ -137,11 +137,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - static struct sr_dev_driver colead_slm_driver_info = { .name = "colead-slm", .longname = "Colead SLM", @@ -157,7 +152,7 @@ static struct sr_dev_driver colead_slm_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(colead_slm_driver_info); diff --git a/src/hardware/deree-de5000/api.c b/src/hardware/deree-de5000/api.c index 2544b5e1..a20f817a 100644 --- a/src/hardware/deree-de5000/api.c +++ b/src/hardware/deree-de5000/api.c @@ -57,7 +57,7 @@ static struct sr_dev_driver deree_de5000_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = es51919_serial_acquisition_start, - .dev_acquisition_stop = es51919_serial_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(deree_de5000_driver_info); diff --git a/src/hardware/fluke-dmm/api.c b/src/hardware/fluke-dmm/api.c index 423ca309..158e6f90 100644 --- a/src/hardware/fluke-dmm/api.c +++ b/src/hardware/fluke-dmm/api.c @@ -244,11 +244,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - static struct sr_dev_driver flukedmm_driver_info = { .name = "fluke-dmm", .longname = "Fluke 18x/28x series DMMs", @@ -264,7 +259,7 @@ static struct sr_dev_driver flukedmm_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(flukedmm_driver_info); diff --git a/src/hardware/gmc-mh-1x-2x/api.c b/src/hardware/gmc-mh-1x-2x/api.c index 6b2508dd..048a0afc 100644 --- a/src/hardware/gmc-mh-1x-2x/api.c +++ b/src/hardware/gmc-mh-1x-2x/api.c @@ -468,11 +468,6 @@ static int dev_acquisition_start_2x_bd232(const struct sr_dev_inst *sdi) return req_meas14(sdi); } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - static struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info = { .name = "gmc-mh-1x-2x-rs232", .longname = "Gossen Metrawatt Metrahit 1x/2x, RS232 interface", @@ -488,7 +483,7 @@ static struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info = { .dev_open = std_serial_dev_open, .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start_1x_2x_rs232, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(gmc_mh_1x_2x_rs232_driver_info); @@ -508,7 +503,7 @@ static struct sr_dev_driver gmc_mh_2x_bd232_driver_info = { .dev_open = std_serial_dev_open, .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start_2x_bd232, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(gmc_mh_2x_bd232_driver_info); diff --git a/src/hardware/kern-scale/api.c b/src/hardware/kern-scale/api.c index ed6c70e8..5a7afee6 100644 --- a/src/hardware/kern-scale/api.c +++ b/src/hardware/kern-scale/api.c @@ -174,11 +174,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - #define SCALE(ID, CHIPSET, VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, \ VALID, PARSE) \ &((struct scale_info) { \ @@ -196,7 +191,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi) .dev_open = std_serial_dev_open, \ .dev_close = std_serial_dev_close, \ .dev_acquisition_start = dev_acquisition_start, \ - .dev_acquisition_stop = dev_acquisition_stop, \ + .dev_acquisition_stop = std_serial_dev_acquisition_stop, \ .context = NULL, \ }, \ VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, \ diff --git a/src/hardware/korad-kaxxxxp/api.c b/src/hardware/korad-kaxxxxp/api.c index da6c0de9..c6e75255 100644 --- a/src/hardware/korad-kaxxxxp/api.c +++ b/src/hardware/korad-kaxxxxp/api.c @@ -360,14 +360,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - - return std_serial_dev_acquisition_stop(sdi); -} - static struct sr_dev_driver korad_kaxxxxp_driver_info = { .name = "korad-kaxxxxp", .longname = "Korad KAxxxxP", @@ -382,7 +374,7 @@ static struct sr_dev_driver korad_kaxxxxp_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(korad_kaxxxxp_driver_info); diff --git a/src/hardware/manson-hcs-3xxx/api.c b/src/hardware/manson-hcs-3xxx/api.c index d49f6129..97a9a300 100644 --- a/src/hardware/manson-hcs-3xxx/api.c +++ b/src/hardware/manson-hcs-3xxx/api.c @@ -369,11 +369,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - static struct sr_dev_driver manson_hcs_3xxx_driver_info = { .name = "manson-hcs-3xxx", .longname = "Manson HCS-3xxx", @@ -388,7 +383,7 @@ static struct sr_dev_driver manson_hcs_3xxx_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(manson_hcs_3xxx_driver_info); diff --git a/src/hardware/mic-985xx/api.c b/src/hardware/mic-985xx/api.c index 4a070bcc..5f9ea71a 100644 --- a/src/hardware/mic-985xx/api.c +++ b/src/hardware/mic-985xx/api.c @@ -195,11 +195,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, int idx) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - /* Driver-specific API function wrappers */ #define HW_SCAN(X) \ static GSList *scan_##X(struct sr_dev_driver *di, GSList *options) { \ @@ -231,7 +226,7 @@ static struct sr_dev_driver ID##_driver_info = { \ .dev_open = std_serial_dev_open, \ .dev_close = std_serial_dev_close, \ .dev_acquisition_start = dev_acquisition_start_##ID_UPPER, \ - .dev_acquisition_stop = dev_acquisition_stop, \ + .dev_acquisition_stop = std_serial_dev_acquisition_stop, \ .context = NULL, \ }; \ SR_REGISTER_DEV_DRIVER(ID##_driver_info) diff --git a/src/hardware/motech-lps-30x/api.c b/src/hardware/motech-lps-30x/api.c index 1b227e78..1fe0d86c 100644 --- a/src/hardware/motech-lps-30x/api.c +++ b/src/hardware/motech-lps-30x/api.c @@ -780,11 +780,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - static struct sr_dev_driver motech_lps_301_driver_info = { .name = "motech-lps-301", .longname = "Motech LPS-301", @@ -800,7 +795,7 @@ static struct sr_dev_driver motech_lps_301_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(motech_lps_301_driver_info); diff --git a/src/hardware/norma-dmm/api.c b/src/hardware/norma-dmm/api.c index a4f33c07..eb2ba25c 100644 --- a/src/hardware/norma-dmm/api.c +++ b/src/hardware/norma-dmm/api.c @@ -219,11 +219,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - static struct sr_dev_driver norma_dmm_driver_info = { .name = "norma-dmm", .longname = "Norma DM9x0 DMMs", @@ -239,7 +234,7 @@ static struct sr_dev_driver norma_dmm_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(norma_dmm_driver_info); @@ -259,7 +254,7 @@ static struct sr_dev_driver siemens_b102x_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(siemens_b102x_driver_info); diff --git a/src/hardware/pce-322a/api.c b/src/hardware/pce-322a/api.c index f40db9e6..202e3122 100644 --- a/src/hardware/pce-322a/api.c +++ b/src/hardware/pce-322a/api.c @@ -319,11 +319,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - static struct sr_dev_driver pce_322a_driver_info = { .name = "pce-322a", .longname = "PCE PCE-322A", @@ -339,7 +334,7 @@ static struct sr_dev_driver pce_322a_driver_info = { .dev_open = dev_open, .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(pce_322a_driver_info); diff --git a/src/hardware/serial-dmm/api.c b/src/hardware/serial-dmm/api.c index 570ec785..2c436f08 100644 --- a/src/hardware/serial-dmm/api.c +++ b/src/hardware/serial-dmm/api.c @@ -195,11 +195,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - #define DMM(ID, CHIPSET, VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, TIMEOUT, \ DELAY, REQUEST, VALID, PARSE, DETAILS) \ &((struct dmm_info) { \ @@ -217,7 +212,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi) .dev_open = std_serial_dev_open, \ .dev_close = std_serial_dev_close, \ .dev_acquisition_start = dev_acquisition_start, \ - .dev_acquisition_stop = dev_acquisition_stop, \ + .dev_acquisition_stop = std_serial_dev_acquisition_stop, \ .context = NULL, \ }, \ VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, TIMEOUT, DELAY, \ diff --git a/src/hardware/teleinfo/api.c b/src/hardware/teleinfo/api.c index 51ea1186..4cfadf4b 100644 --- a/src/hardware/teleinfo/api.c +++ b/src/hardware/teleinfo/api.c @@ -179,11 +179,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - static struct sr_dev_driver teleinfo_driver_info = { .name = "teleinfo", .longname = "Teleinfo", @@ -199,7 +194,7 @@ static struct sr_dev_driver teleinfo_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(teleinfo_driver_info); diff --git a/src/hardware/tondaj-sl-814/api.c b/src/hardware/tondaj-sl-814/api.c index 68c02026..ecf26d1d 100644 --- a/src/hardware/tondaj-sl-814/api.c +++ b/src/hardware/tondaj-sl-814/api.c @@ -149,11 +149,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } -static int dev_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -} - static struct sr_dev_driver tondaj_sl_814_driver_info = { .name = "tondaj-sl-814", .longname = "Tondaj SL-814", @@ -169,7 +164,7 @@ static struct sr_dev_driver tondaj_sl_814_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(tondaj_sl_814_driver_info); diff --git a/src/lcr/es51919.c b/src/lcr/es51919.c index ad364611..15e524b8 100644 --- a/src/lcr/es51919.c +++ b/src/lcr/es51919.c @@ -923,8 +923,3 @@ SR_PRIV int es51919_serial_acquisition_start(const struct sr_dev_inst *sdi) return SR_OK; } - -SR_PRIV int es51919_serial_acquisition_stop(struct sr_dev_inst *sdi) -{ - return std_serial_dev_acquisition_stop(sdi); -}