diff --git a/src/device.c b/src/device.c index 1394fb3b..069ad153 100644 --- a/src/device.c +++ b/src/device.c @@ -551,7 +551,7 @@ SR_API int sr_dev_clear(const struct sr_dev_driver *driver) if (driver->dev_clear) ret = driver->dev_clear(driver); else - ret = std_dev_clear(driver, NULL); + ret = std_dev_clear_with_callback(driver, NULL); return ret; } diff --git a/src/hardware/asix-sigma/api.c b/src/hardware/asix-sigma/api.c index 41a775a5..542aadbb 100644 --- a/src/hardware/asix-sigma/api.c +++ b/src/hardware/asix-sigma/api.c @@ -61,7 +61,7 @@ static const int32_t trigger_matches[] = { static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, sigma_clear_helper); + return std_dev_clear_with_callback(di, sigma_clear_helper); } static GSList *scan(struct sr_dev_driver *di, GSList *options) diff --git a/src/hardware/chronovu-la/api.c b/src/hardware/chronovu-la/api.c index 8824abbd..d6ed20d9 100644 --- a/src/hardware/chronovu-la/api.c +++ b/src/hardware/chronovu-la/api.c @@ -55,7 +55,7 @@ static void clear_helper(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, clear_helper); + return std_dev_clear_with_callback(di, clear_helper); } static int add_device(int model, struct libusb_device_descriptor *des, diff --git a/src/hardware/demo/api.c b/src/hardware/demo/api.c index 3dd32433..55b17376 100644 --- a/src/hardware/demo/api.c +++ b/src/hardware/demo/api.c @@ -198,7 +198,7 @@ static void clear_helper(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, clear_helper); + return std_dev_clear_with_callback(di, clear_helper); } static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, diff --git a/src/hardware/dreamsourcelab-dslogic/api.c b/src/hardware/dreamsourcelab-dslogic/api.c index d11861bb..17793224 100644 --- a/src/hardware/dreamsourcelab-dslogic/api.c +++ b/src/hardware/dreamsourcelab-dslogic/api.c @@ -293,7 +293,7 @@ static void clear_dev_context(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, clear_dev_context); + return std_dev_clear_with_callback(di, clear_dev_context); } static int dev_open(struct sr_dev_inst *sdi) diff --git a/src/hardware/ftdi-la/api.c b/src/hardware/ftdi-la/api.c index b1832ee3..8e4f5eda 100644 --- a/src/hardware/ftdi-la/api.c +++ b/src/hardware/ftdi-la/api.c @@ -251,7 +251,7 @@ static void clear_helper(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, clear_helper); + return std_dev_clear_with_callback(di, clear_helper); } static int dev_open(struct sr_dev_inst *sdi) diff --git a/src/hardware/fx2lafw/api.c b/src/hardware/fx2lafw/api.c index 547f7229..1f6aef29 100644 --- a/src/hardware/fx2lafw/api.c +++ b/src/hardware/fx2lafw/api.c @@ -356,7 +356,7 @@ static void clear_dev_context(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, clear_dev_context); + return std_dev_clear_with_callback(di, clear_dev_context); } static int dev_open(struct sr_dev_inst *sdi) diff --git a/src/hardware/hameg-hmo/api.c b/src/hardware/hameg-hmo/api.c index 9245869b..afdeb456 100644 --- a/src/hardware/hameg-hmo/api.c +++ b/src/hardware/hameg-hmo/api.c @@ -126,7 +126,7 @@ static void clear_helper(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, clear_helper); + return std_dev_clear_with_callback(di, clear_helper); } static int dev_open(struct sr_dev_inst *sdi) diff --git a/src/hardware/hantek-6xxx/api.c b/src/hardware/hantek-6xxx/api.c index a17ec668..e815603f 100644 --- a/src/hardware/hantek-6xxx/api.c +++ b/src/hardware/hantek-6xxx/api.c @@ -167,7 +167,7 @@ static void clear_dev_context(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, clear_dev_context); + return std_dev_clear_with_callback(di, clear_dev_context); } static GSList *scan(struct sr_dev_driver *di, GSList *options) diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c index 84ee45b8..8d624edd 100644 --- a/src/hardware/hantek-dso/api.c +++ b/src/hardware/hantek-dso/api.c @@ -244,7 +244,7 @@ static void clear_dev_context(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, clear_dev_context); + return std_dev_clear_with_callback(di, clear_dev_context); } static GSList *scan(struct sr_dev_driver *di, GSList *options) diff --git a/src/hardware/hung-chang-dso-2100/api.c b/src/hardware/hung-chang-dso-2100/api.c index 0aa012a1..419b40bc 100644 --- a/src/hardware/hung-chang-dso-2100/api.c +++ b/src/hardware/hung-chang-dso-2100/api.c @@ -238,7 +238,7 @@ static int dev_clear(const struct sr_dev_driver *di) } } - return std_dev_clear(di, clear_private); + return std_dev_clear_with_callback(di, clear_private); } static int dev_open(struct sr_dev_inst *sdi) diff --git a/src/hardware/ikalogic-scanalogic2/api.c b/src/hardware/ikalogic-scanalogic2/api.c index 3b8175c8..3189909c 100644 --- a/src/hardware/ikalogic-scanalogic2/api.c +++ b/src/hardware/ikalogic-scanalogic2/api.c @@ -167,7 +167,7 @@ static void clear_dev_context(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, &clear_dev_context); + return std_dev_clear_with_callback(di, &clear_dev_context); } static int dev_open(struct sr_dev_inst *sdi) diff --git a/src/hardware/ikalogic-scanaplus/api.c b/src/hardware/ikalogic-scanaplus/api.c index 9f8f2506..8ea35182 100644 --- a/src/hardware/ikalogic-scanaplus/api.c +++ b/src/hardware/ikalogic-scanaplus/api.c @@ -57,7 +57,7 @@ static void clear_helper(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, clear_helper); + return std_dev_clear_with_callback(di, clear_helper); } static GSList *scan(struct sr_dev_driver *di, GSList *options) diff --git a/src/hardware/lecroy-xstream/api.c b/src/hardware/lecroy-xstream/api.c index 245c421a..cf9df601 100644 --- a/src/hardware/lecroy-xstream/api.c +++ b/src/hardware/lecroy-xstream/api.c @@ -130,7 +130,7 @@ static void clear_helper(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, clear_helper); + return std_dev_clear_with_callback(di, clear_helper); } static int dev_open(struct sr_dev_inst *sdi) diff --git a/src/hardware/motech-lps-30x/api.c b/src/hardware/motech-lps-30x/api.c index 88e4449e..fe396199 100644 --- a/src/hardware/motech-lps-30x/api.c +++ b/src/hardware/motech-lps-30x/api.c @@ -507,7 +507,7 @@ static void dev_clear_private(struct dev_context *devc) static int dev_clear_lps301(const struct sr_dev_driver *di) { - return std_dev_clear(di, (std_dev_clear_callback)dev_clear_private); + return std_dev_clear_with_callback(di, (std_dev_clear_callback)dev_clear_private); } static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, diff --git a/src/hardware/pce-322a/api.c b/src/hardware/pce-322a/api.c index 5dd4d7b8..3ac85730 100644 --- a/src/hardware/pce-322a/api.c +++ b/src/hardware/pce-322a/api.c @@ -105,7 +105,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, NULL); + return std_dev_clear_with_callback(di, NULL); } static int config_get(uint32_t key, GVariant **data, diff --git a/src/hardware/pipistrello-ols/api.c b/src/hardware/pipistrello-ols/api.c index 7dd94f8c..4440be67 100644 --- a/src/hardware/pipistrello-ols/api.c +++ b/src/hardware/pipistrello-ols/api.c @@ -201,7 +201,7 @@ static void clear_helper(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, clear_helper); + return std_dev_clear_with_callback(di, clear_helper); } static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, diff --git a/src/hardware/rigol-ds/api.c b/src/hardware/rigol-ds/api.c index bd4c7118..59e29fb9 100644 --- a/src/hardware/rigol-ds/api.c +++ b/src/hardware/rigol-ds/api.c @@ -293,7 +293,7 @@ static void clear_helper(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, clear_helper); + return std_dev_clear_with_callback(di, clear_helper); } static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi) diff --git a/src/hardware/rohde-schwarz-sme-0x/api.c b/src/hardware/rohde-schwarz-sme-0x/api.c index 25096dd1..25c56a34 100644 --- a/src/hardware/rohde-schwarz-sme-0x/api.c +++ b/src/hardware/rohde-schwarz-sme-0x/api.c @@ -157,7 +157,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, NULL); + return std_dev_clear_with_callback(di, NULL); } static int dev_open(struct sr_dev_inst *sdi) diff --git a/src/hardware/saleae-logic-pro/api.c b/src/hardware/saleae-logic-pro/api.c index a5b59e4f..d568f3ea 100644 --- a/src/hardware/saleae-logic-pro/api.c +++ b/src/hardware/saleae-logic-pro/api.c @@ -182,7 +182,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, NULL); + return std_dev_clear_with_callback(di, NULL); } static int dev_open(struct sr_dev_inst *sdi) diff --git a/src/hardware/scpi-pps/api.c b/src/hardware/scpi-pps/api.c index 707d2626..f4514d8e 100644 --- a/src/hardware/scpi-pps/api.c +++ b/src/hardware/scpi-pps/api.c @@ -300,7 +300,7 @@ static void clear_helper(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, clear_helper); + return std_dev_clear_with_callback(di, clear_helper); } static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, diff --git a/src/hardware/serial-lcr/api.c b/src/hardware/serial-lcr/api.c index 580add49..1beeefbb 100644 --- a/src/hardware/serial-lcr/api.c +++ b/src/hardware/serial-lcr/api.c @@ -35,7 +35,7 @@ struct lcr_es51919_info { static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, es51919_serial_clean); + return std_dev_clear_with_callback(di, es51919_serial_clean); } static GSList *scan(struct sr_dev_driver *di, GSList *options) diff --git a/src/hardware/sysclk-lwla/api.c b/src/hardware/sysclk-lwla/api.c index 34dc884d..8373a0eb 100644 --- a/src/hardware/sysclk-lwla/api.c +++ b/src/hardware/sysclk-lwla/api.c @@ -224,7 +224,7 @@ static void clear_dev_context(void *priv) */ static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, &clear_dev_context); + return std_dev_clear_with_callback(di, &clear_dev_context); } /* Drain any pending data from the USB transfer buffers on the device. diff --git a/src/hardware/yokogawa-dlm/api.c b/src/hardware/yokogawa-dlm/api.c index 606dc2be..95a345b9 100644 --- a/src/hardware/yokogawa-dlm/api.c +++ b/src/hardware/yokogawa-dlm/api.c @@ -136,7 +136,7 @@ static void clear_helper(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, clear_helper); + return std_dev_clear_with_callback(di, clear_helper); } static int dev_open(struct sr_dev_inst *sdi) diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index 6ce65ff7..97d1cdde 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -940,7 +940,7 @@ SR_PRIV int std_serial_dev_acquisition_stop(struct sr_dev_inst *sdi); #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); -SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver, +SR_PRIV int std_dev_clear_with_callback(const struct sr_dev_driver *driver, std_dev_clear_callback clear_private); SR_PRIV GSList *std_dev_list(const struct sr_dev_driver *di); SR_PRIV int std_serial_dev_close(struct sr_dev_inst *sdi); diff --git a/src/std.c b/src/std.c index 8ce27615..915a2455 100644 --- a/src/std.c +++ b/src/std.c @@ -349,7 +349,7 @@ SR_PRIV int std_serial_dev_acquisition_stop(struct sr_dev_inst *sdi) * @retval SR_ERR_BUG Implementation bug. * @retval other Other error. */ -SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver, +SR_PRIV int std_dev_clear_with_callback(const struct sr_dev_driver *driver, std_dev_clear_callback clear_private) { struct drv_context *drvc;