From: Bert Vermeulen Date: Fri, 25 Jan 2013 15:05:48 +0000 (+0100) Subject: drivers: Trim unused config_get() calls X-Git-Tag: dsupstream~304 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=6a4710fac267c07cc146b2a3cd23204b08bea552;p=libsigrok.git drivers: Trim unused config_get() calls None of the driver config_get/set/list calls are required. --- diff --git a/backend.c b/backend.c index 4d39502d..0dab1eea 100644 --- a/backend.c +++ b/backend.c @@ -173,14 +173,6 @@ static int sanity_check_all_drivers(void) sr_err("No dev_close in driver %d ('%s').", i, d); errors++; } - if (!drivers[i]->config_get) { - sr_err("No config_get in driver %d ('%s').", i, d); - errors++; - } - if (!drivers[i]->config_set) { - sr_err("No config_set in driver %d ('%s').", i, d); - errors++; - } if (!drivers[i]->dev_acquisition_start) { sr_err("No dev_acquisition_start in driver %d ('%s').", i, d); diff --git a/hardware/agilent-dmm/api.c b/hardware/agilent-dmm/api.c index 227cbfcf..8c792a35 100644 --- a/hardware/agilent-dmm/api.c +++ b/hardware/agilent-dmm/api.c @@ -247,18 +247,6 @@ static int hw_cleanup(void) return SR_OK; } -static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) -{ - (void)sdi; - - switch (id) { - default: - return SR_ERR_ARG; - } - - return SR_OK; -} - static int config_set(int id, const void *value, const struct sr_dev_inst *sdi) { struct dev_context *devc; @@ -381,7 +369,6 @@ SR_PRIV struct sr_dev_driver agdmm_driver_info = { .scan = hw_scan, .dev_list = hw_dev_list, .dev_clear = clear_instances, - .config_get = config_get, .config_set = config_set, .config_list = config_list, .dev_open = hw_dev_open, diff --git a/hardware/colead-slm/api.c b/hardware/colead-slm/api.c index 819e1397..048fdd91 100644 --- a/hardware/colead-slm/api.c +++ b/hardware/colead-slm/api.c @@ -191,18 +191,6 @@ static int hw_cleanup(void) return SR_OK; } -static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) -{ - (void)sdi; - - switch (id) { - default: - return SR_ERR_ARG; - } - - return SR_OK; -} - static int config_set(int id, const void *value, const struct sr_dev_inst *sdi) { struct dev_context *devc; @@ -325,7 +313,6 @@ SR_PRIV struct sr_dev_driver colead_slm_driver_info = { .scan = hw_scan, .dev_list = hw_dev_list, .dev_clear = clear_instances, - .config_get = config_get, .config_set = config_set, .config_list = config_list, .dev_open = hw_dev_open, diff --git a/hardware/fluke-dmm/api.c b/hardware/fluke-dmm/api.c index 8980f25e..331b4afd 100644 --- a/hardware/fluke-dmm/api.c +++ b/hardware/fluke-dmm/api.c @@ -281,18 +281,6 @@ static int hw_cleanup(void) return SR_OK; } -static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) -{ - (void)sdi; - - switch (id) { - default: - return SR_ERR_ARG; - } - - return SR_OK; -} - static int config_set(int id, const void *value, const struct sr_dev_inst *sdi) { struct dev_context *devc; @@ -421,7 +409,6 @@ SR_PRIV struct sr_dev_driver flukedmm_driver_info = { .scan = hw_scan, .dev_list = hw_dev_list, .dev_clear = clear_instances, - .config_get = config_get, .config_set = config_set, .config_list = config_list, .dev_open = hw_dev_open, diff --git a/hardware/hantek-dso/api.c b/hardware/hantek-dso/api.c index 65e7000c..7c2eaa95 100644 --- a/hardware/hantek-dso/api.c +++ b/hardware/hantek-dso/api.c @@ -422,24 +422,6 @@ static int hw_cleanup(void) return SR_OK; } -static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) -{ - uint64_t tmp; - - (void)sdi; - - switch (id) { - /* TODO remove this */ - case SR_CONF_SAMPLERATE: - *data = &tmp; - break; - default: - return SR_ERR_ARG; - } - - return SR_OK; -} - static int config_set(int id, const void *value, const struct sr_dev_inst *sdi) { struct dev_context *devc; @@ -925,7 +907,6 @@ SR_PRIV struct sr_dev_driver hantek_dso_driver_info = { .scan = hw_scan, .dev_list = hw_dev_list, .dev_clear = clear_instances, - .config_get = config_get, .config_set = config_set, .config_list = config_list, .dev_open = hw_dev_open, diff --git a/hardware/lascar-el-usb/api.c b/hardware/lascar-el-usb/api.c index 8ebb4ca0..76285388 100644 --- a/hardware/lascar-el-usb/api.c +++ b/hardware/lascar-el-usb/api.c @@ -213,18 +213,6 @@ static int hw_cleanup(void) return SR_OK; } -static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) -{ - (void)sdi; - - switch (id) { - default: - return SR_ERR_ARG; - } - - return SR_OK; -} - static int config_set(int id, const void *value, const struct sr_dev_inst *sdi) { struct dev_context *devc; @@ -491,7 +479,6 @@ SR_PRIV struct sr_dev_driver lascar_el_usb_driver_info = { .scan = hw_scan, .dev_list = hw_dev_list, .dev_clear = clear_instances, - .config_get = config_get, .config_set = config_set, .config_list = config_list, .dev_open = hw_dev_open, diff --git a/hardware/nexus-osciprime/api.c b/hardware/nexus-osciprime/api.c index d0b61078..c35e2cfb 100644 --- a/hardware/nexus-osciprime/api.c +++ b/hardware/nexus-osciprime/api.c @@ -265,20 +265,6 @@ static int hw_cleanup(void) return SR_OK; } -static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) -{ - /* TODO */ - (void)data; - (void)sdi; - - switch (id) { - default: - return SR_ERR_ARG; - } - - return SR_OK; -} - static int config_set(int id, const void *value, const struct sr_dev_inst *sdi) { int ret; @@ -348,7 +334,6 @@ SR_PRIV struct sr_dev_driver nexus_osciprime_driver_info = { .scan = hw_scan, .dev_list = hw_dev_list, .dev_clear = clear_instances, - .config_get = config_get, .config_set = config_set, .config_list = config_list, .dev_open = hw_dev_open, diff --git a/hardware/rigol-ds1xx2/api.c b/hardware/rigol-ds1xx2/api.c index 3e3aa542..5d2e36b6 100644 --- a/hardware/rigol-ds1xx2/api.c +++ b/hardware/rigol-ds1xx2/api.c @@ -324,18 +324,6 @@ static int hw_cleanup(void) return SR_OK; } -static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) -{ - (void)sdi; - - switch (id) { - default: - return SR_ERR_ARG; - } - - return SR_OK; -} - static int config_set(int id, const void *value, const struct sr_dev_inst *sdi) { struct dev_context *devc; @@ -520,7 +508,6 @@ SR_PRIV struct sr_dev_driver rigol_ds1xx2_driver_info = { .scan = hw_scan, .dev_list = hw_dev_list, .dev_clear = clear_instances, - .config_get = config_get, .config_set = config_set, .config_list = config_list, .dev_open = hw_dev_open, diff --git a/hardware/serial-dmm/api.c b/hardware/serial-dmm/api.c index 69dd3a3e..b3b0a8ef 100644 --- a/hardware/serial-dmm/api.c +++ b/hardware/serial-dmm/api.c @@ -373,18 +373,6 @@ static int hw_cleanup(int dmm) return SR_OK; } -static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) -{ - (void)sdi; - - switch (id) { - default: - return SR_ERR_ARG; - } - - return SR_OK; -} - static int config_set(int id, const void *value, const struct sr_dev_inst *sdi) { struct dev_context *devc; @@ -533,7 +521,6 @@ SR_PRIV struct sr_dev_driver ID##_driver_info = { \ .scan = hw_scan_##ID_UPPER, \ .dev_list = hw_dev_list_##ID_UPPER, \ .dev_clear = clear_instances_##ID_UPPER, \ - .config_get = config_get, \ .config_set = config_set, \ .config_list = config_list, \ .dev_open = hw_dev_open, \ diff --git a/hardware/tondaj-sl-814/api.c b/hardware/tondaj-sl-814/api.c index 47c2e67f..9edc441b 100644 --- a/hardware/tondaj-sl-814/api.c +++ b/hardware/tondaj-sl-814/api.c @@ -195,18 +195,6 @@ static int hw_cleanup(void) return SR_OK; } -static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) -{ - (void)sdi; - - switch (id) { - default: - return SR_ERR_ARG; - } - - return SR_OK; -} - static int config_set(int id, const void *value, const struct sr_dev_inst *sdi) { struct dev_context *devc; @@ -318,7 +306,6 @@ SR_PRIV struct sr_dev_driver tondaj_sl_814_driver_info = { .scan = hw_scan, .dev_list = hw_dev_list, .dev_clear = clear_instances, - .config_get = config_get, .config_set = config_set, .config_list = config_list, .dev_open = hw_dev_open, diff --git a/hardware/uni-t-dmm/api.c b/hardware/uni-t-dmm/api.c index 7ac43333..26b3e16e 100644 --- a/hardware/uni-t-dmm/api.c +++ b/hardware/uni-t-dmm/api.c @@ -186,27 +186,6 @@ static int hw_cleanup(void) return SR_OK; } -static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) -{ - (void)sdi; - - sr_spew("Backend requested info_id %d.", id); - - switch (id) { - case SR_CONF_SAMPLERATE: - /* TODO: Get rid of this. */ - *data = NULL; - sr_spew("%s: Returning current samplerate.", __func__); - return SR_ERR_ARG; - break; - default: - return SR_ERR_ARG; - break; - } - - return SR_OK; -} - static int config_set(int id, const void *value, const struct sr_dev_inst *sdi) { struct dev_context *devc; @@ -321,7 +300,6 @@ SR_PRIV struct sr_dev_driver uni_t_ut61d_driver_info = { .scan = hw_scan, .dev_list = hw_dev_list, .dev_clear = clear_instances, - .config_get = config_get, .config_set = config_set, .config_list = config_list, .dev_open = hw_dev_open, @@ -340,7 +318,6 @@ SR_PRIV struct sr_dev_driver voltcraft_vc820_driver_info = { .scan = hw_scan, .dev_list = hw_dev_list, .dev_clear = clear_instances, - .config_get = config_get, .config_set = config_set, .config_list = config_list, .dev_open = hw_dev_open, diff --git a/hardware/victor-dmm/api.c b/hardware/victor-dmm/api.c index 1e8cd4ae..53178b2a 100644 --- a/hardware/victor-dmm/api.c +++ b/hardware/victor-dmm/api.c @@ -244,18 +244,6 @@ static int hw_cleanup(void) return SR_OK; } -static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) -{ - (void)sdi; - - switch (id) { - default: - return SR_ERR_ARG; - } - - return SR_OK; -} - static int config_set(int id, const void *value, const struct sr_dev_inst *sdi) { struct dev_context *devc; @@ -477,7 +465,6 @@ SR_PRIV struct sr_dev_driver victor_dmm_driver_info = { .scan = hw_scan, .dev_list = hw_dev_list, .dev_clear = clear_instances, - .config_get = config_get, .config_set = config_set, .config_list = config_list, .dev_open = hw_dev_open,