From: Lars-Peter Clausen Date: Sun, 8 May 2016 12:26:56 +0000 (+0200) Subject: Drop unnecessary struct sr_dev_driver forward declarations X-Git-Tag: libsigrok-0.5.0~386 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=e32862ebccac5ae063abc68d9ce13a66ad46bb97;p=libsigrok.git Drop unnecessary struct sr_dev_driver forward declarations Most drivers have a forward declaration to their sr_dev_driver struct at the beginning of the driver file. This is due to historic reasons and often no longer required. So remove all the unnecessary forward declarations. Some drivers still require the forward declaration, but only reference the driver struct from within the driver scan() callback. Since the driver struct is passed to the scan callback replace the references to the global variable with the local parameter. In some cases this requires adding the parameter to some of the helper functions that are called from the scan() callback. Signed-off-by: Lars-Peter Clausen --- diff --git a/src/hardware/agilent-dmm/api.c b/src/hardware/agilent-dmm/api.c index b5ba7ae2..bb7c53e4 100644 --- a/src/hardware/agilent-dmm/api.c +++ b/src/hardware/agilent-dmm/api.c @@ -70,8 +70,6 @@ static const struct agdmm_profile supported_agdmm[] = { ALL_ZERO }; -SR_PRIV struct sr_dev_driver agdmm_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct sr_dev_inst *sdi; diff --git a/src/hardware/appa-55ii/api.c b/src/hardware/appa-55ii/api.c index 09b24cb2..4c297c18 100644 --- a/src/hardware/appa-55ii/api.c +++ b/src/hardware/appa-55ii/api.c @@ -42,8 +42,6 @@ static const char *data_sources[] = { "Memory", }; -SR_PRIV struct sr_dev_driver appa_55ii_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct drv_context *drvc; diff --git a/src/hardware/arachnid-labs-re-load-pro/api.c b/src/hardware/arachnid-labs-re-load-pro/api.c index 248d6549..6683e283 100644 --- a/src/hardware/arachnid-labs-re-load-pro/api.c +++ b/src/hardware/arachnid-labs-re-load-pro/api.c @@ -56,8 +56,6 @@ static const uint32_t devopts_cg[] = { SR_CONF_UNDER_VOLTAGE_CONDITION_ACTIVE | SR_CONF_GET, }; -SR_PRIV struct sr_dev_driver arachnid_labs_re_load_pro_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct sr_dev_inst *sdi; @@ -133,7 +131,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sdi->vendor = g_strdup("Arachnid Labs"); sdi->model = g_strdup("Re:load Pro"); sdi->version = g_strdup(buf + 8); - sdi->driver = &arachnid_labs_re_load_pro_driver_info; + sdi->driver = di; sdi->inst_type = SR_INST_SERIAL; sdi->conn = serial; diff --git a/src/hardware/asix-sigma/api.c b/src/hardware/asix-sigma/api.c index c9aceaec..fb0c6952 100644 --- a/src/hardware/asix-sigma/api.c +++ b/src/hardware/asix-sigma/api.c @@ -26,8 +26,6 @@ #include #include "protocol.h" -SR_PRIV struct sr_dev_driver asix_sigma_driver_info; - /* * Channel numbers seem to go from 1-16, according to this image: * http://tools.asix.net/img/sigma_sigmacab_pins_720.jpg diff --git a/src/hardware/atten-pps3xxx/api.c b/src/hardware/atten-pps3xxx/api.c index 82a1cdaa..e0e38389 100644 --- a/src/hardware/atten-pps3xxx/api.c +++ b/src/hardware/atten-pps3xxx/api.c @@ -75,8 +75,6 @@ static const struct pps_model models[] = { }, }; -SR_PRIV struct sr_dev_driver atten_pps3203_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options, int modelid) { struct sr_dev_inst *sdi; diff --git a/src/hardware/baylibre-acme/api.c b/src/hardware/baylibre-acme/api.c index cfc8e6c8..66653691 100644 --- a/src/hardware/baylibre-acme/api.c +++ b/src/hardware/baylibre-acme/api.c @@ -22,8 +22,6 @@ #include #include -SR_PRIV struct sr_dev_driver baylibre_acme_driver_info; - static const uint32_t devopts[] = { SR_CONF_CONTINUOUS, SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET, diff --git a/src/hardware/beaglelogic/api.c b/src/hardware/beaglelogic/api.c index 37468ac3..e862d99e 100644 --- a/src/hardware/beaglelogic/api.c +++ b/src/hardware/beaglelogic/api.c @@ -21,8 +21,6 @@ #include "protocol.h" #include "beaglelogic.h" -SR_PRIV struct sr_dev_driver beaglelogic_driver_info; - /* Scan options */ static const uint32_t scanopts[] = { SR_CONF_NUM_LOGIC_CHANNELS, diff --git a/src/hardware/brymen-bm86x/api.c b/src/hardware/brymen-bm86x/api.c index afed5771..9d1600e7 100644 --- a/src/hardware/brymen-bm86x/api.c +++ b/src/hardware/brymen-bm86x/api.c @@ -33,8 +33,6 @@ static const uint32_t devopts[] = { SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET, }; -SR_PRIV struct sr_dev_driver brymen_bm86x_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { GSList *usb_devices, *devices, *l; diff --git a/src/hardware/brymen-dmm/api.c b/src/hardware/brymen-dmm/api.c index 4d70e9ed..b38ba375 100644 --- a/src/hardware/brymen-dmm/api.c +++ b/src/hardware/brymen-dmm/api.c @@ -32,10 +32,8 @@ static const uint32_t devopts[] = { SR_CONF_LIMIT_MSEC | SR_CONF_SET, }; -SR_PRIV struct sr_dev_driver brymen_bm857_driver_info; -static struct sr_dev_driver *di = &brymen_bm857_driver_info; - -static GSList *brymen_scan(const char *conn, const char *serialcomm) +static GSList *brymen_scan(struct sr_dev_driver *di, const char *conn, + const char *serialcomm) { struct sr_dev_inst *sdi; struct dev_context *devc; @@ -118,10 +116,10 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) if (serialcomm) { /* Use the provided comm specs. */ - devices = brymen_scan(conn, serialcomm); + devices = brymen_scan(di, conn, serialcomm); } else { /* But 9600/8n1 should work all of the time. */ - devices = brymen_scan(conn, "9600/8n1/dtr=1/rts=1"); + devices = brymen_scan(di, conn, "9600/8n1/dtr=1/rts=1"); } return devices; diff --git a/src/hardware/cem-dt-885x/api.c b/src/hardware/cem-dt-885x/api.c index e31eaf2a..6134ba6d 100644 --- a/src/hardware/cem-dt-885x/api.c +++ b/src/hardware/cem-dt-885x/api.c @@ -69,8 +69,6 @@ static const char *data_sources[] = { "Memory", }; -SR_PRIV struct sr_dev_driver cem_dt_885x_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct drv_context *drvc; diff --git a/src/hardware/chronovu-la/api.c b/src/hardware/chronovu-la/api.c index 0508250c..329b45bd 100644 --- a/src/hardware/chronovu-la/api.c +++ b/src/hardware/chronovu-la/api.c @@ -21,9 +21,6 @@ #include #include "protocol.h" -SR_PRIV struct sr_dev_driver chronovu_la_driver_info; -static struct sr_dev_driver *di = &chronovu_la_driver_info; - static const uint32_t drvopts[] = { SR_CONF_LOGIC_ANALYZER, }; @@ -64,9 +61,9 @@ static int dev_clear(const struct sr_dev_driver *di) return std_dev_clear(di, clear_helper); } -static int add_device(int model, struct libusb_device_descriptor *des, - const char *serial_num, const char *connection_id, - libusb_device *usbdev, GSList **devices) +static int add_device(struct sr_dev_driver *di, int model, + struct libusb_device_descriptor *des, const char *serial_num, + const char *connection_id, libusb_device *usbdev, GSList **devices) { int ret; unsigned int i; @@ -228,7 +225,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) libusb_get_bus_number(devlist[i]), libusb_get_device_address(devlist[i]), connection_id); - if ((ret = add_device(model, &des, serial_num, connection_id, + if ((ret = add_device(di, model, &des, serial_num, connection_id, devlist[i], &devices)) < 0) { sr_dbg("Failed to add device: %d.", ret); } diff --git a/src/hardware/colead-slm/api.c b/src/hardware/colead-slm/api.c index ac13da99..f83ca1c9 100644 --- a/src/hardware/colead-slm/api.c +++ b/src/hardware/colead-slm/api.c @@ -42,8 +42,6 @@ static const uint32_t devopts[] = { SR_CONF_LIMIT_MSEC | SR_CONF_SET, }; -SR_PRIV struct sr_dev_driver colead_slm_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct drv_context *drvc; diff --git a/src/hardware/conrad-digi-35-cpu/api.c b/src/hardware/conrad-digi-35-cpu/api.c index 708afa22..20382feb 100644 --- a/src/hardware/conrad-digi-35-cpu/api.c +++ b/src/hardware/conrad-digi-35-cpu/api.c @@ -39,8 +39,6 @@ static const uint32_t devopts[] = { SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_SET, }; -SR_PRIV struct sr_dev_driver conrad_digi_35_cpu_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct sr_dev_inst *sdi; diff --git a/src/hardware/demo/demo.c b/src/hardware/demo/demo.c index e70cf966..cf520ca4 100644 --- a/src/hardware/demo/demo.c +++ b/src/hardware/demo/demo.c @@ -175,8 +175,6 @@ static const uint8_t pattern_sigrok[] = { 0xbe, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -SR_PRIV struct sr_dev_driver demo_driver_info; - static int dev_acquisition_stop(struct sr_dev_inst *sdi); static void generate_analog_pattern(struct analog_gen *ag, uint64_t sample_rate) diff --git a/src/hardware/deree-de5000/api.c b/src/hardware/deree-de5000/api.c index 7fca5c60..bbdb7b70 100644 --- a/src/hardware/deree-de5000/api.c +++ b/src/hardware/deree-de5000/api.c @@ -37,8 +37,6 @@ static void std_dev_attach(struct sr_dev_driver *di, struct sr_dev_inst *sdi) #define LOG_PREFIX "deree-de5000" -SR_PRIV struct sr_dev_driver deree_de5000_driver_info; - static int dev_clear(const struct sr_dev_driver *di) { return std_dev_clear(di, es51919_serial_clean); diff --git a/src/hardware/fluke-dmm/api.c b/src/hardware/fluke-dmm/api.c index 61da487b..f0472411 100644 --- a/src/hardware/fluke-dmm/api.c +++ b/src/hardware/fluke-dmm/api.c @@ -39,8 +39,6 @@ static const uint32_t devopts[] = { SR_CONF_LIMIT_MSEC | SR_CONF_SET, }; -SR_PRIV struct sr_dev_driver flukedmm_driver_info; - static const char *scan_conn[] = { /* 287/289 */ "115200/8n1", diff --git a/src/hardware/ftdi-la/api.c b/src/hardware/ftdi-la/api.c index c49c9c7d..ad58c501 100644 --- a/src/hardware/ftdi-la/api.c +++ b/src/hardware/ftdi-la/api.c @@ -24,8 +24,6 @@ #include "libsigrok-internal.h" #include "protocol.h" -SR_PRIV struct sr_dev_driver ftdi_la_driver_info; - static const uint32_t scanopts[] = { SR_CONF_CONN, }; diff --git a/src/hardware/fx2lafw/api.c b/src/hardware/fx2lafw/api.c index 54db1f36..74293597 100644 --- a/src/hardware/fx2lafw/api.c +++ b/src/hardware/fx2lafw/api.c @@ -207,8 +207,6 @@ static const uint64_t dslogic_samplerates[] = { SR_MHZ(400), }; -SR_PRIV struct sr_dev_driver fx2lafw_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct drv_context *drvc; diff --git a/src/hardware/gmc-mh-1x-2x/api.c b/src/hardware/gmc-mh-1x-2x/api.c index 378b6263..049907ae 100644 --- a/src/hardware/gmc-mh-1x-2x/api.c +++ b/src/hardware/gmc-mh-1x-2x/api.c @@ -32,9 +32,6 @@ #define SERIALCOMM_2X "9600/8n1/dtr=1/rts=1/flow=0" #define VENDOR_GMC "Gossen Metrawatt" -SR_PRIV struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info; -SR_PRIV struct sr_dev_driver gmc_mh_2x_bd232_driver_info; - static const uint32_t scanopts[] = { SR_CONF_CONN, SR_CONF_SERIALCOMM, diff --git a/src/hardware/hantek-6xxx/api.c b/src/hardware/hantek-6xxx/api.c index 1bc0dbff..1227e7b9 100644 --- a/src/hardware/hantek-6xxx/api.c +++ b/src/hardware/hantek-6xxx/api.c @@ -74,13 +74,12 @@ static const uint64_t vdivs[][2] = { VDIV_VALUES }; -SR_PRIV struct sr_dev_driver hantek_6xxx_driver_info; - static int read_channel(const struct sr_dev_inst *sdi, uint32_t amount); static int dev_acquisition_stop(struct sr_dev_inst *sdi); -static struct sr_dev_inst *hantek_6xxx_dev_new(const struct hantek_6xxx_profile *prof) +static struct sr_dev_inst *hantek_6xxx_dev_new(struct sr_dev_driver *di, + const struct hantek_6xxx_profile *prof) { struct sr_dev_inst *sdi; struct sr_channel *ch; @@ -93,7 +92,7 @@ static struct sr_dev_inst *hantek_6xxx_dev_new(const struct hantek_6xxx_profile sdi->status = SR_ST_INITIALIZING; sdi->vendor = g_strdup(prof->vendor); sdi->model = g_strdup(prof->model); - sdi->driver = &hantek_6xxx_driver_info; + sdi->driver = di; for (i = 0; i < ARRAY_SIZE(channel_names); i++) { ch = sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, channel_names[i]); @@ -223,7 +222,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) /* Device matches the pre-firmware profile. */ prof = &dev_profiles[j]; sr_dbg("Found a %s %s.", prof->vendor, prof->model); - sdi = hantek_6xxx_dev_new(prof); + sdi = hantek_6xxx_dev_new(di, prof); sdi->connection_id = g_strdup(connection_id); devices = g_slist_append(devices, sdi); devc = sdi->priv; @@ -242,7 +241,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) /* Device matches the post-firmware profile. */ prof = &dev_profiles[j]; sr_dbg("Found a %s %s.", prof->vendor, prof->model); - sdi = hantek_6xxx_dev_new(prof); + sdi = hantek_6xxx_dev_new(di, prof); sdi->connection_id = g_strdup(connection_id); sdi->status = SR_ST_INACTIVE; devices = g_slist_append(devices, sdi); diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c index 7faaa166..f8fdc1a4 100644 --- a/src/hardware/hantek-dso/api.c +++ b/src/hardware/hantek-dso/api.c @@ -160,11 +160,10 @@ static const char *coupling[] = { "GND", }; -SR_PRIV struct sr_dev_driver hantek_dso_driver_info; - static int dev_acquisition_stop(struct sr_dev_inst *sdi); -static struct sr_dev_inst *dso_dev_new(const struct dso_profile *prof) +static struct sr_dev_inst *dso_dev_new(struct sr_dev_driver *di, + const struct dso_profile *prof) { struct sr_dev_inst *sdi; struct sr_channel *ch; @@ -177,7 +176,7 @@ static struct sr_dev_inst *dso_dev_new(const struct dso_profile *prof) sdi->status = SR_ST_INITIALIZING; sdi->vendor = g_strdup(prof->vendor); sdi->model = g_strdup(prof->model); - sdi->driver = &hantek_dso_driver_info; + sdi->driver = di; /* * Add only the real channels -- EXT isn't a source of data, only @@ -209,7 +208,7 @@ static struct sr_dev_inst *dso_dev_new(const struct dso_profile *prof) devc->triggersource = g_strdup(DEFAULT_TRIGGER_SOURCE); devc->triggerposition = DEFAULT_HORIZ_TRIGGERPOS; sdi->priv = devc; - drvc = hantek_dso_driver_info.context; + drvc = di->context; drvc->instances = g_slist_append(drvc->instances, sdi); return sdi; @@ -314,7 +313,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) /* Device matches the pre-firmware profile. */ prof = &dev_profiles[j]; sr_dbg("Found a %s %s.", prof->vendor, prof->model); - sdi = dso_dev_new(prof); + sdi = dso_dev_new(di, prof); sdi->connection_id = g_strdup(connection_id); devices = g_slist_append(devices, sdi); devc = sdi->priv; @@ -333,7 +332,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) /* Device matches the post-firmware profile. */ prof = &dev_profiles[j]; sr_dbg("Found a %s %s.", prof->vendor, prof->model); - sdi = dso_dev_new(prof); + sdi = dso_dev_new(di, prof); sdi->connection_id = g_strdup(connection_id); sdi->status = SR_ST_INACTIVE; devices = g_slist_append(devices, sdi); diff --git a/src/hardware/hantek-dso/dso.c b/src/hardware/hantek-dso/dso.c index 8561ac3d..06037e29 100644 --- a/src/hardware/hantek-dso/dso.c +++ b/src/hardware/hantek-dso/dso.c @@ -29,8 +29,6 @@ #define NUM_CHANNELS 2 -extern struct sr_dev_driver hantek_dso_driver_info; - static int send_begin(const struct sr_dev_inst *sdi) { struct sr_usb_dev_inst *usb; @@ -111,7 +109,7 @@ err: SR_PRIV int dso_open(struct sr_dev_inst *sdi) { struct dev_context *devc; - struct drv_context *drvc = hantek_dso_driver_info.context; + struct drv_context *drvc = sdi->driver->context; struct sr_usb_dev_inst *usb; struct libusb_device_descriptor des; libusb_device **devlist; diff --git a/src/hardware/hung-chang-dso-2100/api.c b/src/hardware/hung-chang-dso-2100/api.c index 6f0910fe..dc575e4f 100644 --- a/src/hardware/hung-chang-dso-2100/api.c +++ b/src/hardware/hung-chang-dso-2100/api.c @@ -22,8 +22,6 @@ #include #include "protocol.h" -SR_PRIV struct sr_dev_driver hung_chang_dso_2100_driver_info; - static const uint32_t scanopts[] = { SR_CONF_CONN, }; diff --git a/src/hardware/ikalogic-scanalogic2/api.c b/src/hardware/ikalogic-scanalogic2/api.c index a36acf07..ad98cc98 100644 --- a/src/hardware/ikalogic-scanalogic2/api.c +++ b/src/hardware/ikalogic-scanalogic2/api.c @@ -52,8 +52,6 @@ static const char *channel_names[] = { "0", "1", "2", "3", }; -SR_PRIV struct sr_dev_driver ikalogic_scanalogic2_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { GSList *usb_devices, *devices, *l; @@ -79,7 +77,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) for (l = usb_devices; l; l = l->next) { usb = l->data; - if ((ret = sl2_get_device_info(*usb, &dev_info)) < 0) { + if ((ret = sl2_get_device_info(di, *usb, &dev_info)) < 0) { sr_warn("Failed to get device information: %d.", ret); sr_usb_dev_inst_free(usb); continue; diff --git a/src/hardware/ikalogic-scanalogic2/protocol.c b/src/hardware/ikalogic-scanalogic2/protocol.c index f18e2924..621fb000 100644 --- a/src/hardware/ikalogic-scanalogic2/protocol.c +++ b/src/hardware/ikalogic-scanalogic2/protocol.c @@ -20,8 +20,6 @@ #include #include "protocol.h" -extern struct sr_dev_driver ikalogic_scanalogic2_driver_info; - extern uint64_t sl2_samplerates[NUM_SAMPLERATES]; static void stop_acquisition(struct sr_dev_inst *sdi) @@ -627,14 +625,14 @@ SR_PRIV void sl2_calculate_trigger_samples(const struct sr_dev_inst *sdi) devc->post_trigger_bytes = post_trigger_bytes; } -SR_PRIV int sl2_get_device_info(struct sr_usb_dev_inst usb, - struct device_info *dev_info) +SR_PRIV int sl2_get_device_info(struct sr_dev_driver *di, + struct sr_usb_dev_inst usb, struct device_info *dev_info) { struct drv_context *drvc; uint8_t buffer[PACKET_LENGTH]; int ret; - drvc = ikalogic_scanalogic2_driver_info.context; + drvc = di->context; if (!dev_info) return SR_ERR_ARG; diff --git a/src/hardware/ikalogic-scanalogic2/protocol.h b/src/hardware/ikalogic-scanalogic2/protocol.h index 60793375..d7a27357 100644 --- a/src/hardware/ikalogic-scanalogic2/protocol.h +++ b/src/hardware/ikalogic-scanalogic2/protocol.h @@ -227,8 +227,8 @@ SR_PRIV int sl2_set_capture_ratio(const struct sr_dev_inst *sdi, SR_PRIV int sl2_set_after_trigger_delay(const struct sr_dev_inst *sdi, uint64_t after_trigger_delay); SR_PRIV void sl2_calculate_trigger_samples(const struct sr_dev_inst *sdi); -SR_PRIV int sl2_get_device_info(struct sr_usb_dev_inst usb, - struct device_info *dev_info); +SR_PRIV int sl2_get_device_info(struct sr_dev_driver *di, + struct sr_usb_dev_inst usb, struct device_info *dev_info); SR_PRIV int sl2_transfer_in(libusb_device_handle *dev_handle, uint8_t *data); SR_PRIV int sl2_transfer_out(libusb_device_handle *dev_handle, uint8_t *data); diff --git a/src/hardware/ikalogic-scanaplus/api.c b/src/hardware/ikalogic-scanaplus/api.c index bb8689bd..04547624 100644 --- a/src/hardware/ikalogic-scanaplus/api.c +++ b/src/hardware/ikalogic-scanaplus/api.c @@ -44,8 +44,6 @@ static const char *channel_names[] = { /* Note: The IKALOGIC ScanaPLUS always samples at 100MHz. */ static const uint64_t samplerates[1] = { SR_MHZ(100) }; -SR_PRIV struct sr_dev_driver ikalogic_scanaplus_driver_info; - static int dev_acquisition_stop(struct sr_dev_inst *sdi); static void clear_helper(void *priv) diff --git a/src/hardware/kecheng-kc-330b/api.c b/src/hardware/kecheng-kc-330b/api.c index b3fc1321..1cc84240 100644 --- a/src/hardware/kecheng-kc-330b/api.c +++ b/src/hardware/kecheng-kc-330b/api.c @@ -61,8 +61,6 @@ static const char *data_sources[] = { "Memory", }; -SR_PRIV struct sr_dev_driver kecheng_kc_330b_driver_info; - static int scan_kecheng(struct sr_dev_driver *di, struct sr_usb_dev_inst *usb, char **model) { diff --git a/src/hardware/kecheng-kc-330b/protocol.c b/src/hardware/kecheng-kc-330b/protocol.c index e1c8da17..644d9677 100644 --- a/src/hardware/kecheng-kc-330b/protocol.c +++ b/src/hardware/kecheng-kc-330b/protocol.c @@ -20,8 +20,6 @@ #include #include #include "protocol.h" - -extern struct sr_dev_driver kecheng_kc_330b_driver_info; extern const uint64_t kecheng_kc_330b_sample_intervals[][2]; SR_PRIV int kecheng_kc_330b_handle_events(int fd, int revents, void *cb_data) diff --git a/src/hardware/korad-kaxxxxp/api.c b/src/hardware/korad-kaxxxxp/api.c index e008cfe4..8316690f 100644 --- a/src/hardware/korad-kaxxxxp/api.c +++ b/src/hardware/korad-kaxxxxp/api.c @@ -62,8 +62,6 @@ static const struct korad_kaxxxxp_model models[] = { ALL_ZERO }; -SR_PRIV struct sr_dev_driver korad_kaxxxxp_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct drv_context *drvc; diff --git a/src/hardware/lascar-el-usb/api.c b/src/hardware/lascar-el-usb/api.c index 960a97ea..ad2d18b8 100644 --- a/src/hardware/lascar-el-usb/api.c +++ b/src/hardware/lascar-el-usb/api.c @@ -24,8 +24,6 @@ #include "libsigrok-internal.h" #include "protocol.h" -SR_PRIV struct sr_dev_driver lascar_el_usb_driver_info; - static const uint32_t scanopts[] = { SR_CONF_CONN, }; diff --git a/src/hardware/lecroy-logicstudio/api.c b/src/hardware/lecroy-logicstudio/api.c index fd73a700..ae73738a 100644 --- a/src/hardware/lecroy-logicstudio/api.c +++ b/src/hardware/lecroy-logicstudio/api.c @@ -71,8 +71,6 @@ static const uint64_t samplerates[] = { SR_MHZ(500), }; -SR_PRIV struct sr_dev_driver lecroy_logicstudio_driver_info; - static struct sr_dev_inst *create_device(struct sr_dev_driver *di, struct sr_usb_dev_inst *usb, enum sr_dev_inst_status status, int64_t fw_updated) diff --git a/src/hardware/link-mso19/api.c b/src/hardware/link-mso19/api.c index c3abb0ae..f2b372eb 100644 --- a/src/hardware/link-mso19/api.c +++ b/src/hardware/link-mso19/api.c @@ -50,8 +50,6 @@ static const uint64_t samplerates[] = { SR_HZ(100), }; -SR_PRIV struct sr_dev_driver link_mso19_driver_info; - /* TODO: Use sr_dev_inst to store connection handle & use std_dev_clear(). */ static int dev_clear(const struct sr_dev_driver *di) { diff --git a/src/hardware/link-mso19/protocol.c b/src/hardware/link-mso19/protocol.c index 8d4f9056..ae4d1615 100644 --- a/src/hardware/link-mso19/protocol.c +++ b/src/hardware/link-mso19/protocol.c @@ -30,8 +30,6 @@ static const char mso_head[] = { 0x40, 0x4c, 0x44, 0x53, 0x7e }; static const char mso_foot[] = { 0x7e }; -extern SR_PRIV struct sr_dev_driver link_mso19_driver_info; - SR_PRIV int mso_send_control_message(struct sr_serial_dev_inst *serial, uint16_t payload[], int n) { diff --git a/src/hardware/manson-hcs-3xxx/api.c b/src/hardware/manson-hcs-3xxx/api.c index 4a253a18..feeef963 100644 --- a/src/hardware/manson-hcs-3xxx/api.c +++ b/src/hardware/manson-hcs-3xxx/api.c @@ -73,8 +73,6 @@ static const struct hcs_model models[] = { ALL_ZERO }; -SR_PRIV struct sr_dev_driver manson_hcs_3xxx_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { int i, model_id; diff --git a/src/hardware/motech-lps-30x/api.c b/src/hardware/motech-lps-30x/api.c index 57befbfd..7194f313 100644 --- a/src/hardware/motech-lps-30x/api.c +++ b/src/hardware/motech-lps-30x/api.c @@ -28,9 +28,6 @@ #include #include #include "protocol.h" - -/* Forward declarations */ -SR_PRIV struct sr_dev_driver motech_lps_301_driver_info; SR_PRIV int lps_read_reply(struct sr_serial_dev_inst *serial, char **buf, int *buflen); SR_PRIV int lps_send_va(struct sr_serial_dev_inst *serial, const char *fmt, va_list args); SR_PRIV int lps_cmd_ok(struct sr_serial_dev_inst *serial, const char *fmt, ...); diff --git a/src/hardware/openbench-logic-sniffer/api.c b/src/hardware/openbench-logic-sniffer/api.c index a70e3168..d8f7cc4d 100644 --- a/src/hardware/openbench-logic-sniffer/api.c +++ b/src/hardware/openbench-logic-sniffer/api.c @@ -85,8 +85,6 @@ static const uint64_t samplerates[] = { #define RESPONSE_DELAY_US (10 * 1000) -SR_PRIV struct sr_dev_driver ols_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct sr_config *src; diff --git a/src/hardware/pipistrello-ols/api.c b/src/hardware/pipistrello-ols/api.c index b9da2f98..dd815586 100644 --- a/src/hardware/pipistrello-ols/api.c +++ b/src/hardware/pipistrello-ols/api.c @@ -75,8 +75,6 @@ static const uint64_t samplerates[] = { SR_HZ(1), }; -SR_PRIV struct sr_dev_driver p_ols_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct sr_dev_inst *sdi; diff --git a/src/hardware/saleae-logic16/api.c b/src/hardware/saleae-logic16/api.c index 98bf26bd..4c120b1c 100644 --- a/src/hardware/saleae-logic16/api.c +++ b/src/hardware/saleae-logic16/api.c @@ -39,8 +39,6 @@ #define MAX_RENUM_DELAY_MS 3000 #define NUM_SIMUL_TRANSFERS 32 -SR_PRIV struct sr_dev_driver saleae_logic16_driver_info; - static const uint32_t scanopts[] = { SR_CONF_CONN, }; diff --git a/src/hardware/teleinfo/api.c b/src/hardware/teleinfo/api.c index 4bccde01..c9ea8c7d 100644 --- a/src/hardware/teleinfo/api.c +++ b/src/hardware/teleinfo/api.c @@ -36,8 +36,6 @@ static const uint32_t devopts[] = { SR_CONF_LIMIT_MSEC | SR_CONF_SET, }; -SR_PRIV struct sr_dev_driver teleinfo_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct drv_context *drvc; diff --git a/src/hardware/testo/api.c b/src/hardware/testo/api.c index 2ae985db..a2eae04d 100644 --- a/src/hardware/testo/api.c +++ b/src/hardware/testo/api.c @@ -22,8 +22,6 @@ #include "protocol.h" #define SERIALCOMM "115200/8n1" - -SR_PRIV struct sr_dev_driver testo_driver_info; static int dev_acquisition_stop(struct sr_dev_inst *sdi); static const uint32_t scanopts[] = { diff --git a/src/hardware/tondaj-sl-814/api.c b/src/hardware/tondaj-sl-814/api.c index 8628ea30..4caae642 100644 --- a/src/hardware/tondaj-sl-814/api.c +++ b/src/hardware/tondaj-sl-814/api.c @@ -39,8 +39,6 @@ static const uint32_t devopts[] = { SR_CONF_LIMIT_MSEC | SR_CONF_SET, }; -SR_PRIV struct sr_dev_driver tondaj_sl_814_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct drv_context *drvc; diff --git a/src/hardware/uni-t-ut32x/api.c b/src/hardware/uni-t-ut32x/api.c index b6385705..aed53aad 100644 --- a/src/hardware/uni-t-ut32x/api.c +++ b/src/hardware/uni-t-ut32x/api.c @@ -37,8 +37,6 @@ static const char *data_sources[] = { "Memory", }; -SR_PRIV struct sr_dev_driver uni_t_ut32x_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct drv_context *drvc; diff --git a/src/hardware/uni-t-ut32x/protocol.c b/src/hardware/uni-t-ut32x/protocol.c index 01fa6f72..4287e393 100644 --- a/src/hardware/uni-t-ut32x/protocol.c +++ b/src/hardware/uni-t-ut32x/protocol.c @@ -22,8 +22,6 @@ #include #include "protocol.h" -extern struct sr_dev_driver uni_t_ut32x_driver_info; - static float parse_temperature(unsigned char *buf) { float temp; diff --git a/src/hardware/victor-dmm/api.c b/src/hardware/victor-dmm/api.c index 9a07cc83..a53d8c51 100644 --- a/src/hardware/victor-dmm/api.c +++ b/src/hardware/victor-dmm/api.c @@ -31,8 +31,6 @@ #define VICTOR_VENDOR "Victor" #define VICTOR_INTERFACE 0 #define VICTOR_ENDPOINT (LIBUSB_ENDPOINT_IN | 1) - -SR_PRIV struct sr_dev_driver victor_dmm_driver_info; static int dev_acquisition_stop(struct sr_dev_inst *sdi); static const uint32_t drvopts[] = { diff --git a/src/hardware/zeroplus-logic-cube/api.c b/src/hardware/zeroplus-logic-cube/api.c index 6a593027..dd001495 100644 --- a/src/hardware/zeroplus-logic-cube/api.c +++ b/src/hardware/zeroplus-logic-cube/api.c @@ -79,8 +79,6 @@ static const char *channel_names[] = { "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", }; -SR_PRIV struct sr_dev_driver zeroplus_logic_cube_driver_info; - /* * The hardware supports more samplerates than these, but these are the * options hardcoded into the vendor's Windows GUI.