From: Uwe Hermann Date: Fri, 31 May 2013 14:09:57 +0000 (+0200) Subject: s/clear_instances/dev_clear/. X-Git-Tag: libsigrok-0.2.1~75 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3b412e3a305cf06ac9bbb91ca5025d1712617b71;p=libsigrok.git s/clear_instances/dev_clear/. Consistently use the same name for the dev_clear() API callback everywhere. --- diff --git a/hardware/agilent-dmm/api.c b/hardware/agilent-dmm/api.c index 41e3075d..34fa92ad 100644 --- a/hardware/agilent-dmm/api.c +++ b/hardware/agilent-dmm/api.c @@ -61,7 +61,7 @@ static const struct agdmm_profile supported_agdmm[] = { SR_PRIV struct sr_dev_driver agdmm_driver_info; static struct sr_dev_driver *di = &agdmm_driver_info; -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, NULL); } @@ -197,7 +197,7 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(void) { - return clear_instances(); + return dev_clear(); } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) @@ -295,7 +295,7 @@ SR_PRIV struct sr_dev_driver agdmm_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = clear_instances, + .dev_clear = dev_clear, .config_get = NULL, .config_set = config_set, .config_list = config_list, diff --git a/hardware/alsa/api.c b/hardware/alsa/api.c index 2d4da263..dd5588dd 100644 --- a/hardware/alsa/api.c +++ b/hardware/alsa/api.c @@ -46,7 +46,7 @@ static void clear_helper(void *priv) g_free((void *)devc->samplerates); } -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, clear_helper); } @@ -123,7 +123,7 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(void) { - return clear_instances(); + return dev_clear(); } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi) @@ -325,7 +325,7 @@ SR_PRIV struct sr_dev_driver alsa_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = clear_instances, + .dev_clear = dev_clear, .config_get = config_get, .config_set = config_set, .config_list = config_list, diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index a0975776..f542b536 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -389,7 +389,7 @@ static void clear_helper(void *priv) ftdi_deinit(&devc->ftdic); } -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, clear_helper); } @@ -741,7 +741,7 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(void) { - return clear_instances(); + return dev_clear(); } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi) @@ -1398,7 +1398,7 @@ SR_PRIV struct sr_dev_driver asix_sigma_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = clear_instances, + .dev_clear = dev_clear, .config_get = config_get, .config_set = config_set, .config_list = config_list, diff --git a/hardware/brymen-dmm/api.c b/hardware/brymen-dmm/api.c index fc371a79..7302243e 100644 --- a/hardware/brymen-dmm/api.c +++ b/hardware/brymen-dmm/api.c @@ -39,7 +39,7 @@ static int init(struct sr_context *sr_ctx) return std_init(sr_ctx, di, LOG_PREFIX); } -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, NULL); } @@ -177,7 +177,7 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(void) { - return clear_instances(); + return dev_clear(); } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) @@ -276,7 +276,7 @@ SR_PRIV struct sr_dev_driver brymen_bm857_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = clear_instances, + .dev_clear = dev_clear, .config_get = NULL, .config_set = config_set, .config_list = config_list, diff --git a/hardware/chronovu-la8/api.c b/hardware/chronovu-la8/api.c index cbf91df3..ec4bf35f 100644 --- a/hardware/chronovu-la8/api.c +++ b/hardware/chronovu-la8/api.c @@ -66,7 +66,7 @@ static void clear_helper(void *priv) g_free(devc->final_buf); } -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, clear_helper); } @@ -259,7 +259,7 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(void) { - return clear_instances(); + return dev_clear(); } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi) @@ -499,7 +499,7 @@ SR_PRIV struct sr_dev_driver chronovu_la8_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = clear_instances, + .dev_clear = dev_clear, .config_get = config_get, .config_set = config_set, .config_list = config_list, diff --git a/hardware/colead-slm/api.c b/hardware/colead-slm/api.c index 44064029..acf0c6eb 100644 --- a/hardware/colead-slm/api.c +++ b/hardware/colead-slm/api.c @@ -45,7 +45,7 @@ static const int32_t hwcaps[] = { SR_PRIV struct sr_dev_driver colead_slm_driver_info; static struct sr_dev_driver *di = &colead_slm_driver_info; -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, NULL); } @@ -144,7 +144,7 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(void) { - return clear_instances(); + return dev_clear(); } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) @@ -243,7 +243,7 @@ SR_PRIV struct sr_dev_driver colead_slm_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = clear_instances, + .dev_clear = dev_clear, .config_get = NULL, .config_set = config_set, .config_list = config_list, diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index 93d47c29..69f48f12 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -143,7 +143,7 @@ static struct sr_dev_driver *di = &demo_driver_info; static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data); -static int clear_instances(void) +static int dev_clear(void) { /* Nothing needed so far. */ @@ -528,7 +528,7 @@ SR_PRIV struct sr_dev_driver demo_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = clear_instances, + .dev_clear = dev_clear, .config_get = config_get, .config_set = config_set, .config_list = config_list, diff --git a/hardware/fluke-dmm/api.c b/hardware/fluke-dmm/api.c index 20021d77..4dd49c19 100644 --- a/hardware/fluke-dmm/api.c +++ b/hardware/fluke-dmm/api.c @@ -58,7 +58,7 @@ static const struct flukedmm_profile supported_flukedmm[] = { { FLUKE_190, "199B", 1000, 3500 }, }; -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, NULL); } @@ -230,7 +230,7 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(void) { - return clear_instances(); + return dev_clear(); } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) @@ -335,7 +335,7 @@ SR_PRIV struct sr_dev_driver flukedmm_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = clear_instances, + .dev_clear = dev_clear, .config_get = NULL, .config_set = config_set, .config_list = config_list, diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index 5932e553..2260cddf 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -346,7 +346,7 @@ static struct dev_context *fx2lafw_dev_new(void) return devc; } -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, NULL); } @@ -567,13 +567,13 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(void) { - struct drv_context *drvc; int ret; + struct drv_context *drvc; if (!(drvc = di->priv)) return SR_OK; - ret = clear_instances(); + ret = dev_clear(); g_free(drvc); di->priv = NULL; @@ -1038,7 +1038,7 @@ SR_PRIV struct sr_dev_driver fx2lafw_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = clear_instances, + .dev_clear = dev_clear, .config_get = config_get, .config_set = config_set, .config_list = config_list, diff --git a/hardware/hantek-dso/api.c b/hardware/hantek-dso/api.c index 6ac9ba61..3a342efc 100644 --- a/hardware/hantek-dso/api.c +++ b/hardware/hantek-dso/api.c @@ -244,7 +244,7 @@ static void clear_dev_context(void *priv) } -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, clear_dev_context); } @@ -419,7 +419,7 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(void) { - return clear_instances(); + return dev_clear(); } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi) @@ -965,7 +965,7 @@ SR_PRIV struct sr_dev_driver hantek_dso_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = clear_instances, + .dev_clear = dev_clear, .config_get = config_get, .config_set = config_set, .config_list = config_list, diff --git a/hardware/lascar-el-usb/api.c b/hardware/lascar-el-usb/api.c index d2eaecde..464eb6b1 100644 --- a/hardware/lascar-el-usb/api.c +++ b/hardware/lascar-el-usb/api.c @@ -38,7 +38,7 @@ static const int32_t hwcaps[] = { SR_CONF_LIMIT_SAMPLES, }; -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, NULL); } @@ -156,7 +156,7 @@ static int cleanup(void) /* Can get called on an unused driver, doesn't matter. */ return SR_OK; - ret = clear_instances(); + ret = dev_clear(); g_free(drvc); di->priv = NULL; @@ -484,7 +484,7 @@ SR_PRIV struct sr_dev_driver lascar_el_usb_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = clear_instances, + .dev_clear = dev_clear, .config_get = config_get, .config_set = config_set, .config_list = config_list, diff --git a/hardware/mic-985xx/api.c b/hardware/mic-985xx/api.c index 858f2a3e..fa14e2f1 100644 --- a/hardware/mic-985xx/api.c +++ b/hardware/mic-985xx/api.c @@ -49,7 +49,7 @@ SR_PRIV const struct mic_dev_info mic_devs[] = { }, }; -static int clear_instances(int idx) +static int dev_clear(int idx) { return std_dev_clear(mic_devs[idx].di, NULL); } @@ -185,7 +185,7 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(int idx) { - return clear_instances(idx); + return dev_clear(idx); } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) @@ -275,8 +275,8 @@ static int cleanup_##X(void) { return cleanup(X); } static GSList *scan_##X(GSList *options) { return scan(options, X); } #define HW_DEV_LIST(X) \ static GSList *dev_list_##X(void) { return dev_list(X); } -#define CLEAR_INSTANCES(X) \ -static int clear_instances_##X(void) { return clear_instances(X); } +#define HW_DEV_CLEAR(X) \ +static int dev_clear_##X(void) { return dev_clear(X); } #define HW_DEV_ACQUISITION_START(X) \ static int dev_acquisition_start_##X(const struct sr_dev_inst *sdi, \ void *cb_data) { return dev_acquisition_start(sdi, cb_data, X); } @@ -287,7 +287,7 @@ HW_INIT(ID_UPPER) \ HW_CLEANUP(ID_UPPER) \ HW_SCAN(ID_UPPER) \ HW_DEV_LIST(ID_UPPER) \ -CLEAR_INSTANCES(ID_UPPER) \ +HW_DEV_CLEAR(ID_UPPER) \ HW_DEV_ACQUISITION_START(ID_UPPER) \ SR_PRIV struct sr_dev_driver ID##_driver_info = { \ .name = NAME, \ @@ -297,7 +297,7 @@ SR_PRIV struct sr_dev_driver ID##_driver_info = { \ .cleanup = cleanup_##ID_UPPER, \ .scan = scan_##ID_UPPER, \ .dev_list = dev_list_##ID_UPPER, \ - .dev_clear = clear_instances_##ID_UPPER, \ + .dev_clear = dev_clear_##ID_UPPER, \ .config_get = NULL, \ .config_set = config_set, \ .config_list = config_list, \ diff --git a/hardware/nexus-osciprime/api.c b/hardware/nexus-osciprime/api.c index b6d1a60b..e1f2d076 100644 --- a/hardware/nexus-osciprime/api.c +++ b/hardware/nexus-osciprime/api.c @@ -105,7 +105,7 @@ static const uint64_t vdivs[][2] = { SR_PRIV struct sr_dev_driver nexus_osciprime_driver_info; static struct sr_dev_driver *di = &nexus_osciprime_driver_info; -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, NULL); } @@ -209,7 +209,7 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(void) { - return clear_instances(); + return dev_clear(); } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) @@ -278,7 +278,7 @@ SR_PRIV struct sr_dev_driver nexus_osciprime_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = clear_instances, + .dev_clear = dev_clear, .config_get = NULL, .config_set = config_set, .config_list = config_list, diff --git a/hardware/rigol-ds1xx2/api.c b/hardware/rigol-ds1xx2/api.c index 04d3f0ae..e6e923cc 100644 --- a/hardware/rigol-ds1xx2/api.c +++ b/hardware/rigol-ds1xx2/api.c @@ -152,7 +152,7 @@ static void clear_helper(void *priv) g_free(devc->trigger_slope); } -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, clear_helper); } @@ -364,7 +364,7 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(void) { - return clear_instances(); + return dev_clear(); } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi) @@ -646,7 +646,7 @@ SR_PRIV struct sr_dev_driver rigol_ds1xx2_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = clear_instances, + .dev_clear = dev_clear, .config_get = config_get, .config_set = config_set, .config_list = config_list, diff --git a/hardware/serial-dmm/api.c b/hardware/serial-dmm/api.c index b0c097cd..5bf63b4f 100644 --- a/hardware/serial-dmm/api.c +++ b/hardware/serial-dmm/api.c @@ -192,7 +192,7 @@ SR_PRIV struct dmm_info dmms[] = { }, }; -static int clear_instances(int dmm) +static int dev_clear(int dmm) { return std_dev_clear(dmms[dmm].di, NULL); } @@ -354,7 +354,7 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(int dmm) { - return clear_instances(dmm); + return dev_clear(dmm); } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) @@ -458,8 +458,8 @@ static int cleanup_##X(void) { return cleanup(X); } static GSList *scan_##X(GSList *options) { return scan(options, X); } #define HW_DEV_LIST(X) \ static GSList *dev_list_##X(void) { return dev_list(X); } -#define CLEAR_INSTANCES(X) \ -static int clear_instances_##X(void) { return clear_instances(X); } +#define HW_DEV_CLEAR(X) \ +static int dev_clear_##X(void) { return dev_clear(X); } #define HW_DEV_ACQUISITION_START(X) \ static int dev_acquisition_start_##X(const struct sr_dev_inst *sdi, \ void *cb_data) { return dev_acquisition_start(sdi, cb_data, X); } @@ -470,7 +470,7 @@ HW_INIT(ID_UPPER) \ HW_CLEANUP(ID_UPPER) \ HW_SCAN(ID_UPPER) \ HW_DEV_LIST(ID_UPPER) \ -CLEAR_INSTANCES(ID_UPPER) \ +HW_DEV_CLEAR(ID_UPPER) \ HW_DEV_ACQUISITION_START(ID_UPPER) \ SR_PRIV struct sr_dev_driver ID##_driver_info = { \ .name = NAME, \ @@ -480,7 +480,7 @@ SR_PRIV struct sr_dev_driver ID##_driver_info = { \ .cleanup = cleanup_##ID_UPPER, \ .scan = scan_##ID_UPPER, \ .dev_list = dev_list_##ID_UPPER, \ - .dev_clear = clear_instances_##ID_UPPER, \ + .dev_clear = dev_clear_##ID_UPPER, \ .config_get = NULL, \ .config_set = config_set, \ .config_list = config_list, \ diff --git a/hardware/tondaj-sl-814/api.c b/hardware/tondaj-sl-814/api.c index 36a884a5..4af87648 100644 --- a/hardware/tondaj-sl-814/api.c +++ b/hardware/tondaj-sl-814/api.c @@ -40,7 +40,7 @@ static const int32_t hwcaps[] = { SR_PRIV struct sr_dev_driver tondaj_sl_814_driver_info; static struct sr_dev_driver *di = &tondaj_sl_814_driver_info; -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, NULL); } @@ -156,7 +156,7 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(void) { - return clear_instances(); + return dev_clear(); } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) @@ -239,7 +239,7 @@ SR_PRIV struct sr_dev_driver tondaj_sl_814_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = clear_instances, + .dev_clear = dev_clear, .config_get = NULL, .config_set = config_set, .config_list = config_list, diff --git a/hardware/uni-t-dmm/api.c b/hardware/uni-t-dmm/api.c index 4570e526..f553b3ac 100644 --- a/hardware/uni-t-dmm/api.c +++ b/hardware/uni-t-dmm/api.c @@ -89,7 +89,7 @@ SR_PRIV struct dmm_info udmms[] = { }, }; -static int clear_instances(int dmm) +static int dev_clear(int dmm) { return std_dev_clear(udmms[dmm].di, NULL); } @@ -196,7 +196,7 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(int dmm) { - return clear_instances(dmm); + return dev_clear(dmm); } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) @@ -299,8 +299,8 @@ static int cleanup_##X(void) { return cleanup(X); } static GSList *scan_##X(GSList *options) { return scan(options, X); } #define HW_DEV_LIST(X) \ static GSList *dev_list_##X(void) { return dev_list(X); } -#define CLEAR_INSTANCES(X) \ -static int clear_instances_##X(void) { return clear_instances(X); } +#define HW_DEV_CLEAR(X) \ +static int dev_clear_##X(void) { return dev_clear(X); } #define HW_DEV_ACQUISITION_START(X) \ static int dev_acquisition_start_##X(const struct sr_dev_inst *sdi, \ void *cb_data) { return dev_acquisition_start(sdi, cb_data, X); } @@ -313,7 +313,7 @@ HW_INIT(ID_UPPER) \ HW_CLEANUP(ID_UPPER) \ HW_SCAN(ID_UPPER) \ HW_DEV_LIST(ID_UPPER) \ -CLEAR_INSTANCES(ID_UPPER) \ +HW_DEV_CLEAR(ID_UPPER) \ HW_DEV_ACQUISITION_START(ID_UPPER) \ HW_DEV_OPEN(ID_UPPER) \ SR_PRIV struct sr_dev_driver ID##_driver_info = { \ @@ -324,7 +324,7 @@ SR_PRIV struct sr_dev_driver ID##_driver_info = { \ .cleanup = cleanup_##ID_UPPER, \ .scan = scan_##ID_UPPER, \ .dev_list = dev_list_##ID_UPPER, \ - .dev_clear = clear_instances_##ID_UPPER, \ + .dev_clear = dev_clear_##ID_UPPER, \ .config_get = NULL, \ .config_set = config_set, \ .config_list = config_list, \ diff --git a/hardware/victor-dmm/api.c b/hardware/victor-dmm/api.c index 41edc1d8..e50e3381 100644 --- a/hardware/victor-dmm/api.c +++ b/hardware/victor-dmm/api.c @@ -46,7 +46,7 @@ static const int32_t hwcaps[] = { SR_CONF_CONTINUOUS, }; -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, NULL); } @@ -198,7 +198,7 @@ static int cleanup(void) /* Can get called on an unused driver, doesn't matter. */ return SR_OK; - ret = clear_instances(); + ret = dev_clear(); g_free(drvc); di->priv = NULL; @@ -443,7 +443,7 @@ SR_PRIV struct sr_dev_driver victor_dmm_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = clear_instances, + .dev_clear = dev_clear, .config_get = config_get, .config_set = config_set, .config_list = config_list, diff --git a/hardware/zeroplus-logic-cube/api.c b/hardware/zeroplus-logic-cube/api.c index 2117afbc..637f22ce 100644 --- a/hardware/zeroplus-logic-cube/api.c +++ b/hardware/zeroplus-logic-cube/api.c @@ -238,7 +238,7 @@ SR_PRIV int zp_set_samplerate(struct dev_context *devc, uint64_t samplerate) return SR_OK; } -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, NULL); } @@ -464,7 +464,7 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(void) { - return clear_instances(); + return dev_clear(); } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi) @@ -663,7 +663,7 @@ SR_PRIV struct sr_dev_driver zeroplus_logic_cube_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = cleanup, + .dev_clear = dev_clear, .config_get = config_get, .config_set = config_set, .config_list = config_list,