]> sigrok.org Git - libsigrok.git/commitdiff
std: Add and use std_dev_clear() where possible.
authorUwe Hermann <redacted>
Tue, 11 Jul 2017 20:14:01 +0000 (22:14 +0200)
committerUwe Hermann <redacted>
Thu, 13 Jul 2017 09:59:11 +0000 (11:59 +0200)
Be explicit and consistent in the drivers about which dev_clear function
will be called to avoid confusion and inconsistencies.

Drop some open-coded implementations of std_dev_clear().

43 files changed:
src/backend.c
src/device.c
src/hardware/agilent-dmm/api.c
src/hardware/appa-55ii/api.c
src/hardware/arachnid-labs-re-load-pro/api.c
src/hardware/atten-pps3xxx/api.c
src/hardware/baylibre-acme/api.c
src/hardware/beaglelogic/api.c
src/hardware/brymen-bm86x/api.c
src/hardware/brymen-dmm/api.c
src/hardware/cem-dt-885x/api.c
src/hardware/center-3xx/api.c
src/hardware/colead-slm/api.c
src/hardware/conrad-digi-35-cpu/api.c
src/hardware/fluke-dmm/api.c
src/hardware/gmc-mh-1x-2x/api.c
src/hardware/gwinstek-gds-800/api.c
src/hardware/hp-3457a/api.c
src/hardware/kecheng-kc-330b/api.c
src/hardware/kern-scale/api.c
src/hardware/korad-kaxxxxp/api.c
src/hardware/lascar-el-usb/api.c
src/hardware/lecroy-logicstudio/api.c
src/hardware/link-mso19/api.c
src/hardware/manson-hcs-3xxx/api.c
src/hardware/maynuo-m97/api.c
src/hardware/mic-985xx/api.c
src/hardware/norma-dmm/api.c
src/hardware/openbench-logic-sniffer/api.c
src/hardware/pce-322a/api.c
src/hardware/rohde-schwarz-sme-0x/api.c
src/hardware/saleae-logic-pro/api.c
src/hardware/saleae-logic16/api.c
src/hardware/serial-dmm/api.c
src/hardware/teleinfo/api.c
src/hardware/testo/api.c
src/hardware/tondaj-sl-814/api.c
src/hardware/uni-t-dmm/api.c
src/hardware/uni-t-ut32x/api.c
src/hardware/victor-dmm/api.c
src/hardware/zeroplus-logic-cube/api.c
src/libsigrok-internal.h
src/std.c

index beb5a8525b4bff4145d8030a2775a27bbb00ca86..e5fe6a3f764edcce2cb678e92f93a22277b6d486 100644 (file)
@@ -309,7 +309,10 @@ static int sanity_check_all_drivers(const struct sr_context *ctx)
                        sr_err("No dev_list in driver %d ('%s').", i, d);
                        errors++;
                }
-               /* Note: dev_clear() is optional. */
+               if (!drivers[i]->dev_clear) {
+                       sr_err("No dev_clear in driver %d ('%s').", i, d);
+                       errors++;
+               }
                /* Note: config_get() is optional. */
                if (!drivers[i]->config_set) {
                        sr_err("No config_set in driver %d ('%s').", i, d);
index 069ad1534cf47270155056044bec728ae75c2df8..ae8f3b8ce5a540f6697c89ba2454dd11d2a8cb56 100644 (file)
@@ -529,8 +529,6 @@ SR_API GSList *sr_dev_list(const struct sr_dev_driver *driver)
  */
 SR_API int sr_dev_clear(const struct sr_dev_driver *driver)
 {
-       int ret;
-
        if (!driver) {
                sr_err("Invalid driver.");
                return SR_ERR_ARG;
@@ -548,12 +546,7 @@ SR_API int sr_dev_clear(const struct sr_dev_driver *driver)
 
        /* No log message here, too verbose and not very useful. */
 
-       if (driver->dev_clear)
-               ret = driver->dev_clear(driver);
-       else
-               ret = std_dev_clear_with_callback(driver, NULL);
-
-       return ret;
+       return driver->dev_clear(driver);
 }
 
 /**
index ab5daaa5518498dc84b968aac65e3121934f96a3..2707976415be6f558c901c84367f93992b9ea0dd 100644 (file)
@@ -348,7 +348,7 @@ static struct sr_dev_driver agdmm_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 0bd40bad316d2989ab3143e4c83b933e15656a60..05024f9683818d97ce8155b5795d3e9bd7e39a85 100644 (file)
@@ -218,7 +218,7 @@ static struct sr_dev_driver appa_55ii_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 7a6e6bcd6b47006df14171886b3819e308ddc03b..4fcd7b8541a1904df1dc90db45decba5b7386a86 100644 (file)
@@ -337,6 +337,7 @@ static struct sr_dev_driver arachnid_labs_re_load_pro_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 59252838341836e71658cc260657ea0160d89fda..a90ab6ff68f80140ba6247fc50fec87b3aed36f0 100644 (file)
@@ -475,7 +475,7 @@ static struct sr_dev_driver atten_pps3203_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan_3203,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 93570f93ea3366247135f179e90252d5ae6aee8e..73538583156e4909a7acb9b5593f089ef5f5e0a5 100644 (file)
@@ -358,6 +358,7 @@ static struct sr_dev_driver baylibre_acme_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index ff8f0424d32049c834a365fe8eefa03c0e4dfe48..2b11fdc7d12eb501a4f491f6f85faa76d048b11b 100644 (file)
@@ -343,6 +343,7 @@ static struct sr_dev_driver beaglelogic_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 5a5f358008c3ac74f04d3345cc8bc7545ba85ed3..c3c1ea621ff5f5a6e1005cdb271eb078de62f7a8 100644 (file)
@@ -221,7 +221,7 @@ static struct sr_dev_driver brymen_bm86x_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 2c43bb3aaf796dc8085f155daa4189dd6b8ccad4..2bf9154b446f00d22dc466d2d16e638ef347da99 100644 (file)
@@ -178,7 +178,7 @@ static struct sr_dev_driver brymen_bm857_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = NULL,
        .config_set = config_set,
        .config_list = config_list,
index 709e92c91c4b753afeaafbc177f8604a4cc0ea01..98db1072cd465e37d86c97e8cda422bfe96d644c 100644 (file)
@@ -366,7 +366,7 @@ static struct sr_dev_driver cem_dt_885x_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 9e618777a8bcaae462bcb1e6482b0d7f9f4d6fc8..97869bce395056ce10995940dd190519b3e299ca 100644 (file)
@@ -196,6 +196,7 @@ static struct sr_dev_driver ID##_driver_info = { \
        .cleanup = std_cleanup, \
        .scan = scan_##ID_UPPER, \
        .dev_list = std_dev_list, \
+       .dev_clear = std_dev_clear, \
        .config_get = NULL, \
        .config_set = config_set, \
        .config_list = config_list, \
index 338462f3fd5abe280e4f7aa542e43ca34370d8d4..c2f0ac08a5b62c7c47d096f3ceb60e2dd7fab659 100644 (file)
@@ -139,7 +139,7 @@ static struct sr_dev_driver colead_slm_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = NULL,
        .config_set = config_set,
        .config_list = config_list,
index b488bcd11f624ff9a9fef4e51f255550585c1977..ba84f476a77f4334ff24231595270d771a6eb6b9 100644 (file)
@@ -166,7 +166,7 @@ static struct sr_dev_driver conrad_digi_35_cpu_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = NULL,
        .config_set = config_set,
        .config_list = config_list,
index 75b0954de5a2716c5104e140078cb5768e7e676e..022a2ca9c621c76aff8fe29fbdfc0b91889b0f6d 100644 (file)
@@ -246,7 +246,7 @@ static struct sr_dev_driver flukedmm_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = NULL,
        .config_set = config_set,
        .config_list = config_list,
index 332c90172db349ad1a6e3ebd8778e35063f1a86f..f94fc851c7dea68273dd2e212e3b0d47d30bed12 100644 (file)
@@ -463,7 +463,7 @@ static struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan_1x_2x_rs232,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list_sm,
@@ -483,7 +483,7 @@ static struct sr_dev_driver gmc_mh_2x_bd232_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan_2x_bd232,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list_bd,
index 0b8262cdebb053175012e3b1f5a301e70f676c76..249074b891834ba10cb90559bd47473f1af2811e 100644 (file)
@@ -229,6 +229,7 @@ static struct sr_dev_driver gwinstek_gds_800_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index f58cfef90cc9774ea71e75bb37d6ad740c7224c0..873fbc07e8a40219aaccc6cc360b1153f71feaeb 100644 (file)
@@ -432,6 +432,7 @@ static struct sr_dev_driver hp_3457a_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index fa50dd698d7a56400e6fa890080404052657077c..15dda4e09d72a96b91510881a10ebb978c1255c6 100644 (file)
@@ -494,7 +494,7 @@ static struct sr_dev_driver kecheng_kc_330b_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 421ab7981cf06d903c6df3127d1298304856af76..7b65a4d67c2f9e0b835c3413cc24fc2c7f736019 100644 (file)
@@ -178,6 +178,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
                        .cleanup = std_cleanup, \
                        .scan = scan, \
                        .dev_list = std_dev_list, \
+                       .dev_clear = std_dev_clear, \
                        .config_get = NULL, \
                        .config_set = config_set, \
                        .config_list = config_list, \
index 3ee69b724a9fbac783ad14e19130d56522f6559d..5ab95c7fbaebaac438c699e36fa4809040d22229 100644 (file)
@@ -364,6 +364,7 @@ static struct sr_dev_driver korad_kaxxxxp_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 9801732a8e70ce1211757abf7030dc9eb029f6f8..7f741280758d47fd00014a533482981d405a98cb 100644 (file)
@@ -402,7 +402,7 @@ SR_PRIV struct sr_dev_driver lascar_el_usb_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index c3007e4210da344695493dd71a17408bb4819663..a372d2c79ac9a80c5bef4c078838ee1de27ebc72 100644 (file)
@@ -488,6 +488,7 @@ static struct sr_dev_driver lecroy_logicstudio_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 5924aeb956edbe228c8b640355a967f536112c90..00be6ac416b205d6639811628af0bd4d36e03e5c 100644 (file)
@@ -399,6 +399,7 @@ static struct sr_dev_driver link_mso19_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 7bae92917e79b3334db9fac302412453df36263c..5d289c3065a832cd0a42829c0e8116dc9ec78f34 100644 (file)
@@ -374,6 +374,7 @@ static struct sr_dev_driver manson_hcs_3xxx_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 23b0e68bc14b63788c1cb581e261849717a373a0..876150a28609ea78ced4be63fc7066fcc5d9ffba 100644 (file)
@@ -458,6 +458,7 @@ static struct sr_dev_driver maynuo_m97_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 492f4b7930395c86a4a121a1e878748df1077335..8be5cbef03cc6b1819d547ad8c48b5e60e5cf18f 100644 (file)
@@ -213,6 +213,7 @@ static struct sr_dev_driver ID##_driver_info = { \
        .cleanup = std_cleanup, \
        .scan = scan_##ID_UPPER, \
        .dev_list = std_dev_list, \
+       .dev_clear = std_dev_clear, \
        .config_get = NULL, \
        .config_set = config_set, \
        .config_list = config_list_##ID_UPPER, \
index c9399402fcc29300ba4a5b475e2a14327e5fa186..29cdbccdb92d2a37baf9aaa7842a418747a5536d 100644 (file)
@@ -221,7 +221,7 @@ static struct sr_dev_driver norma_dmm_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = NULL,
        .config_set = config_set,
        .config_list = config_list,
@@ -241,7 +241,7 @@ static struct sr_dev_driver siemens_b102x_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = NULL,
        .config_set = config_set,
        .config_list = config_list,
index 93fa3bd7e57618209b19655f65aed554df708c29..e3bb1fa5b228e78dccb501f8acf1e2521e8cd34e 100644 (file)
@@ -564,7 +564,7 @@ static struct sr_dev_driver ols_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 3ac85730c65b419fd18a126e4c21fcf4eb415268..14534e2ad9991f4af384483c295018bb30a55d8b 100644 (file)
@@ -103,11 +103,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        return std_scan_complete(di, g_slist_append(NULL, sdi));
 }
 
-static int dev_clear(const struct sr_dev_driver *di)
-{
-       return std_dev_clear_with_callback(di, NULL);
-}
-
 static int config_get(uint32_t key, GVariant **data,
        const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
@@ -347,7 +342,7 @@ static struct sr_dev_driver pce_322a_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = dev_clear,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 25c56a34a7d3092dcfe339af2ae1e7d5abe536fa..21ff6334c081e2209bd5ab3cc35fc4eec51731f9 100644 (file)
@@ -155,11 +155,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        return sr_scpi_scan(di->context, options, rs_probe_serial_device);
 }
 
-static int dev_clear(const struct sr_dev_driver *di)
-{
-       return std_dev_clear_with_callback(di, NULL);
-}
-
 static int dev_open(struct sr_dev_inst *sdi)
 {
        return sr_scpi_open(sdi->conn);
@@ -256,7 +251,7 @@ SR_PRIV struct sr_dev_driver rohde_schwarz_sme_0x_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = dev_clear,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index d568f3ead0b1a15adeecb7c23bdf84a0a15197dd..ef4f49500fa8cb9738ac5d540bc7311ebc026f56 100644 (file)
@@ -180,11 +180,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        return std_scan_complete(di, devices);
 }
 
-static int dev_clear(const struct sr_dev_driver *di)
-{
-       return std_dev_clear_with_callback(di, NULL);
-}
-
 static int dev_open(struct sr_dev_inst *sdi)
 {
        struct sr_dev_driver *di = sdi->driver;
@@ -407,7 +402,7 @@ SR_PRIV struct sr_dev_driver saleae_logic_pro_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = dev_clear,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index ff0af73532dbd09389bdd776ac1e03970e87b8ce..0400ce8375a6c2ce72a0fe3cce8e88f506280a34 100644 (file)
@@ -786,7 +786,7 @@ static struct sr_dev_driver saleae_logic16_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index ad063679fb61fd08522b2a1e90b4a1046c31bc13..99b2a717672da9e50ebff03fe7d713d95c6dcaf5 100644 (file)
@@ -200,6 +200,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
                        .cleanup = std_cleanup, \
                        .scan = scan, \
                        .dev_list = std_dev_list, \
+                       .dev_clear = std_dev_clear, \
                        .config_get = NULL, \
                        .config_set = config_set, \
                        .config_list = config_list, \
index 5e786295be2602cab7d4a1b19d2cc274dac92e7c..980b5b3e6195dbad6c7560c0aed42c5a9eb39340 100644 (file)
@@ -181,7 +181,7 @@ static struct sr_dev_driver teleinfo_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = NULL,
        .config_set = config_set,
        .config_list = config_list,
index 548cdb3d8107865b32b5184cb7dead8d6294d369..062849bfd5e320c80bc36500565fdabaee3f1b2f 100644 (file)
@@ -415,6 +415,7 @@ static struct sr_dev_driver testo_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index bdad1f604fbca5978ad8a900e0ce4c39bf140db3..4330d960a81327060903ded5f2e7c7f961b59962 100644 (file)
@@ -150,7 +150,7 @@ static struct sr_dev_driver tondaj_sl_814_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = NULL,
        .config_set = config_set,
        .config_list = config_list,
index 1dc14872d8163cd82ea862c5b709999e9054c863..eccff3cf1c3f97105a84b6e9b30431f0acd75703 100644 (file)
@@ -175,6 +175,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
                        .cleanup = std_cleanup, \
                        .scan = scan, \
                        .dev_list = std_dev_list, \
+                       .dev_clear = std_dev_clear, \
                        .config_get = NULL, \
                        .config_set = config_set, \
                        .config_list = config_list, \
index 1d12a580a76fbdd844520b1dcc3f111cf08c5504..7d4ca62813f24cabc59fa2270c204b0056eda2da 100644 (file)
@@ -302,7 +302,7 @@ static struct sr_dev_driver uni_t_ut32x_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 66eff890a107ea39b3e76070e54abae070a7b3aa..ebe56feae536c12f4467dd2ab52c92cfddab8739 100644 (file)
@@ -326,7 +326,7 @@ static struct sr_dev_driver victor_dmm_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 8d530e5779dc6877d1c9d9e9d43bfa188bd6e389..e8e7d4fb8d681a04ff3dae6162247d0cf713ebba 100644 (file)
@@ -658,7 +658,7 @@ static struct sr_dev_driver zeroplus_logic_cube_driver_info = {
        .cleanup = std_cleanup,
        .scan = scan,
        .dev_list = std_dev_list,
-       .dev_clear = NULL,
+       .dev_clear = std_dev_clear,
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
index 97d1cddeca456253cfcf316ddf61ff06abf4584f..fe2544fa3a90ed0a03a7d8fa268888b67056e372 100644 (file)
@@ -942,6 +942,7 @@ 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_with_callback(const struct sr_dev_driver *driver,
                std_dev_clear_callback clear_private);
+SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver);
 SR_PRIV GSList *std_dev_list(const struct sr_dev_driver *di);
 SR_PRIV int std_serial_dev_close(struct sr_dev_inst *sdi);
 SR_PRIV GSList *std_scan_complete(struct sr_dev_driver *di, GSList *devices);
index 915a245594e82449c937a845fbd767a33cfe827e..1433f30fb923dcf8b765a33c1d4539255bcfc7e5 100644 (file)
--- a/src/std.c
+++ b/src/std.c
@@ -404,6 +404,11 @@ SR_PRIV int std_dev_clear_with_callback(const struct sr_dev_driver *driver,
        return ret;
 }
 
+SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver)
+{
+       return std_dev_clear_with_callback(driver, NULL);
+}
+
 /**
  * Standard driver dev_list() callback API helper.
  *