aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2016-05-28 13:41:03 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2016-05-31 15:54:52 +0200
commit15f96409dc54fd2ef784c59156daedd9acfa78ed (patch)
tree008fbb1b3c6edb74a722f6bd4379228e3c81cc6c
parentbee2b0168c087676c1b365861d8c2d4714afa9b9 (diff)
std_serial_dev_acquisition_stop(): Remove serial parameter
All callers of std_serial_dev_acquisition_stop() currently pass sdi->conn for the serial parameter. And the other std_serial helper functions already require that the conn field of the sr_driver_inst passed to the functions points to the sr_serial_dev_inst associated with the device. Modify std_serial_dev_acquisition_stop() to follow the same pattern and remove the serial parameter. This simplifies the API and ensures consistent behaviour between different drivers. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
-rw-r--r--src/hardware/agilent-dmm/api.c3
-rw-r--r--src/hardware/appa-55ii/api.c2
-rw-r--r--src/hardware/arachnid-labs-re-load-pro/api.c2
-rw-r--r--src/hardware/brymen-dmm/api.c3
-rw-r--r--src/hardware/cem-dt-885x/api.c3
-rw-r--r--src/hardware/center-3xx/api.c2
-rw-r--r--src/hardware/colead-slm/api.c3
-rw-r--r--src/hardware/fluke-dmm/api.c3
-rw-r--r--src/hardware/gmc-mh-1x-2x/api.c3
-rw-r--r--src/hardware/kern-scale/api.c3
-rw-r--r--src/hardware/korad-kaxxxxp/api.c2
-rw-r--r--src/hardware/manson-hcs-3xxx/api.c2
-rw-r--r--src/hardware/mic-985xx/api.c3
-rw-r--r--src/hardware/motech-lps-30x/api.c3
-rw-r--r--src/hardware/norma-dmm/api.c3
-rw-r--r--src/hardware/pce-322a/api.c3
-rw-r--r--src/hardware/serial-dmm/api.c3
-rw-r--r--src/hardware/teleinfo/api.c2
-rw-r--r--src/hardware/tondaj-sl-814/api.c3
-rw-r--r--src/lcr/es51919.c2
-rw-r--r--src/libsigrok-internal.h3
-rw-r--r--src/std.c6
22 files changed, 23 insertions, 39 deletions
diff --git a/src/hardware/agilent-dmm/api.c b/src/hardware/agilent-dmm/api.c
index 0cfb1ef..bfd2242 100644
--- a/src/hardware/agilent-dmm/api.c
+++ b/src/hardware/agilent-dmm/api.c
@@ -210,8 +210,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn);
+ return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close);
}
static struct sr_dev_driver agdmm_driver_info = {
diff --git a/src/hardware/appa-55ii/api.c b/src/hardware/appa-55ii/api.c
index 4f1233e..9e4dec6 100644
--- a/src/hardware/appa-55ii/api.c
+++ b/src/hardware/appa-55ii/api.c
@@ -218,7 +218,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi,
- std_serial_dev_close, sdi->conn);
+ std_serial_dev_close);
}
static struct sr_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 533be92..49d3908 100644
--- a/src/hardware/arachnid-labs-re-load-pro/api.c
+++ b/src/hardware/arachnid-labs-re-load-pro/api.c
@@ -338,7 +338,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi,
- std_serial_dev_close, sdi->conn);
+ std_serial_dev_close);
}
static struct sr_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 8dc7a16..cb7f875 100644
--- a/src/hardware/brymen-dmm/api.c
+++ b/src/hardware/brymen-dmm/api.c
@@ -178,8 +178,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn);
+ return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close);
}
static struct sr_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 37aa9bf..f7769b0 100644
--- a/src/hardware/cem-dt-885x/api.c
+++ b/src/hardware/cem-dt-885x/api.c
@@ -369,8 +369,7 @@ 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, std_serial_dev_close,
- sdi->conn);
+ return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close);
}
static struct sr_dev_driver cem_dt_885x_driver_info = {
diff --git a/src/hardware/center-3xx/api.c b/src/hardware/center-3xx/api.c
index f5be8a8..98d0d40 100644
--- a/src/hardware/center-3xx/api.c
+++ b/src/hardware/center-3xx/api.c
@@ -186,7 +186,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, int idx)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi,
- std_serial_dev_close, sdi->conn);
+ std_serial_dev_close);
}
/* Driver-specific API function wrappers */
diff --git a/src/hardware/colead-slm/api.c b/src/hardware/colead-slm/api.c
index 3ed4c85..59481df 100644
--- a/src/hardware/colead-slm/api.c
+++ b/src/hardware/colead-slm/api.c
@@ -139,8 +139,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn);
+ return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close);
}
static struct sr_dev_driver colead_slm_driver_info = {
diff --git a/src/hardware/fluke-dmm/api.c b/src/hardware/fluke-dmm/api.c
index f9683e6..a036997 100644
--- a/src/hardware/fluke-dmm/api.c
+++ b/src/hardware/fluke-dmm/api.c
@@ -246,8 +246,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn);
+ return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close);
}
static struct sr_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 a2688ee..00789d4 100644
--- a/src/hardware/gmc-mh-1x-2x/api.c
+++ b/src/hardware/gmc-mh-1x-2x/api.c
@@ -470,8 +470,7 @@ static int dev_acquisition_start_2x_bd232(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- return std_serial_dev_acquisition_stop(sdi, dev_close,
- sdi->conn);
+ return std_serial_dev_acquisition_stop(sdi, dev_close);
}
static struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info = {
diff --git a/src/hardware/kern-scale/api.c b/src/hardware/kern-scale/api.c
index 1af8362..584702d 100644
--- a/src/hardware/kern-scale/api.c
+++ b/src/hardware/kern-scale/api.c
@@ -176,8 +176,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn);
+ return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close);
}
#define SCALE(ID, CHIPSET, VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, \
diff --git a/src/hardware/korad-kaxxxxp/api.c b/src/hardware/korad-kaxxxxp/api.c
index 82a7537..dbff9db 100644
--- a/src/hardware/korad-kaxxxxp/api.c
+++ b/src/hardware/korad-kaxxxxp/api.c
@@ -366,7 +366,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
return SR_ERR_DEV_CLOSED;
return std_serial_dev_acquisition_stop(sdi,
- std_serial_dev_close, sdi->conn);
+ std_serial_dev_close);
}
static struct sr_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 c7394e3..f22d733 100644
--- a/src/hardware/manson-hcs-3xxx/api.c
+++ b/src/hardware/manson-hcs-3xxx/api.c
@@ -372,7 +372,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi,
- std_serial_dev_close, sdi->conn);
+ std_serial_dev_close);
}
static struct sr_dev_driver manson_hcs_3xxx_driver_info = {
diff --git a/src/hardware/mic-985xx/api.c b/src/hardware/mic-985xx/api.c
index 510dbb8..40a6bc3 100644
--- a/src/hardware/mic-985xx/api.c
+++ b/src/hardware/mic-985xx/api.c
@@ -197,8 +197,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, int idx)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn);
+ return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close);
}
/* Driver-specific API function wrappers */
diff --git a/src/hardware/motech-lps-30x/api.c b/src/hardware/motech-lps-30x/api.c
index 5906153..c5e7b61 100644
--- a/src/hardware/motech-lps-30x/api.c
+++ b/src/hardware/motech-lps-30x/api.c
@@ -782,8 +782,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn);
+ return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close);
}
static struct sr_dev_driver motech_lps_301_driver_info = {
diff --git a/src/hardware/norma-dmm/api.c b/src/hardware/norma-dmm/api.c
index 0fcfff8..1ff354c 100644
--- a/src/hardware/norma-dmm/api.c
+++ b/src/hardware/norma-dmm/api.c
@@ -221,8 +221,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn);
+ return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close);
}
static struct sr_dev_driver norma_dmm_driver_info = {
diff --git a/src/hardware/pce-322a/api.c b/src/hardware/pce-322a/api.c
index e53723c..77d885e 100644
--- a/src/hardware/pce-322a/api.c
+++ b/src/hardware/pce-322a/api.c
@@ -321,8 +321,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- return std_serial_dev_acquisition_stop(sdi, dev_close,
- sdi->conn);
+ return std_serial_dev_acquisition_stop(sdi, dev_close);
}
static struct sr_dev_driver pce_322a_driver_info = {
diff --git a/src/hardware/serial-dmm/api.c b/src/hardware/serial-dmm/api.c
index 7cd444f..650aaf2 100644
--- a/src/hardware/serial-dmm/api.c
+++ b/src/hardware/serial-dmm/api.c
@@ -197,8 +197,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn);
+ return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close);
}
#define DMM(ID, CHIPSET, VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, TIMEOUT, \
diff --git a/src/hardware/teleinfo/api.c b/src/hardware/teleinfo/api.c
index d234bb1..a1461f8 100644
--- a/src/hardware/teleinfo/api.c
+++ b/src/hardware/teleinfo/api.c
@@ -182,7 +182,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi,
- std_serial_dev_close, sdi->conn);
+ std_serial_dev_close);
}
static struct sr_dev_driver teleinfo_driver_info = {
diff --git a/src/hardware/tondaj-sl-814/api.c b/src/hardware/tondaj-sl-814/api.c
index d2ef328..ad03350 100644
--- a/src/hardware/tondaj-sl-814/api.c
+++ b/src/hardware/tondaj-sl-814/api.c
@@ -151,8 +151,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn);
+ return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close);
}
static struct sr_dev_driver tondaj_sl_814_driver_info = {
diff --git a/src/lcr/es51919.c b/src/lcr/es51919.c
index d4b802d..7c084f7 100644
--- a/src/lcr/es51919.c
+++ b/src/lcr/es51919.c
@@ -927,5 +927,5 @@ SR_PRIV int es51919_serial_acquisition_start(const struct sr_dev_inst *sdi)
SR_PRIV int es51919_serial_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi,
- std_serial_dev_close, sdi->conn);
+ std_serial_dev_close);
}
diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h
index 2ffffd3..49629d6 100644
--- a/src/libsigrok-internal.h
+++ b/src/libsigrok-internal.h
@@ -927,8 +927,7 @@ SR_PRIV int std_cleanup(const struct sr_dev_driver *di);
#ifdef HAVE_LIBSERIALPORT
SR_PRIV int std_serial_dev_open(struct sr_dev_inst *sdi);
SR_PRIV int std_serial_dev_acquisition_stop(struct sr_dev_inst *sdi,
- dev_close_callback dev_close_fn,
- struct sr_serial_dev_inst *serial);
+ dev_close_callback dev_close_fn);
#endif
SR_PRIV int std_session_send_df_header(const struct sr_dev_inst *sdi);
SR_PRIV int std_session_send_df_end(const struct sr_dev_inst *sdi);
diff --git a/src/std.c b/src/std.c
index 7063231..218f8f3 100644
--- a/src/std.c
+++ b/src/std.c
@@ -206,8 +206,6 @@ SR_PRIV int std_serial_dev_close(struct sr_dev_inst *sdi)
* @param cb_data Opaque 'cb_data' pointer. Must not be NULL.
* @param dev_close_fn Function pointer to the driver's dev_close().
* Must not be NULL.
- * @param serial The serial device instance (struct serial_dev_inst *).
- * Must not be NULL.
*
* @retval SR_OK Success.
* @retval SR_ERR_ARG Invalid arguments.
@@ -215,9 +213,9 @@ SR_PRIV int std_serial_dev_close(struct sr_dev_inst *sdi)
* @retval SR_ERR Other errors.
*/
SR_PRIV int std_serial_dev_acquisition_stop(struct sr_dev_inst *sdi,
- dev_close_callback dev_close_fn,
- struct sr_serial_dev_inst *serial)
+ dev_close_callback dev_close_fn)
{
+ struct sr_serial_dev_inst *serial = sdi->conn;
const char *prefix = sdi->driver->name;
int ret;