]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/hung-chang-dso-2100/api.c
Put driver pointers into special section
[libsigrok.git] / src / hardware / hung-chang-dso-2100 / api.c
index 55b9922b3a24fe736383ce2924380bf6b1369344..039ba3856d8d6a6af1b5726f90a4a99801b7df33 100644 (file)
@@ -22,8 +22,6 @@
 #include <string.h>
 #include "protocol.h"
 
-SR_PRIV struct sr_dev_driver hung_chang_dso_2100_driver_info;
-
 static const uint32_t scanopts[] = {
        SR_CONF_CONN,
 };
@@ -104,11 +102,6 @@ static const uint8_t coupling_map[] = {
        0x00, 0x08, 0x04
 };
 
-static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
-{
-       return std_init(sr_ctx, di, LOG_PREFIX);
-}
-
 static GSList *scan_port(GSList *devices, struct sr_dev_driver *di,
                         struct parport *port)
 {
@@ -230,11 +223,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        return devices;
 }
 
-static GSList *dev_list(const struct sr_dev_driver *di)
-{
-       return ((struct drv_context *)(di->context))->instances;
-}
-
 static void clear_private(void *priv)
 {
        struct dev_context *devc = priv;
@@ -724,14 +712,14 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
        return hung_chang_dso_2100_dev_acquisition_stop(sdi);
 }
 
-SR_PRIV struct sr_dev_driver hung_chang_dso_2100_driver_info = {
+static struct sr_dev_driver hung_chang_dso_2100_driver_info = {
        .name = "hung-chang-dso-2100",
        .longname = "Hung-Chang DSO-2100",
        .api_version = 1,
-       .init = init,
+       .init = std_init,
        .cleanup = std_cleanup,
        .scan = scan,
-       .dev_list = dev_list,
+       .dev_list = std_dev_list,
        .dev_clear = dev_clear,
        .config_get = config_get,
        .config_set = config_set,
@@ -744,3 +732,4 @@ SR_PRIV struct sr_dev_driver hung_chang_dso_2100_driver_info = {
        .dev_acquisition_stop = dev_acquisition_stop,
        .context = NULL,
 };
+SR_REGISTER_DEV_DRIVER(hung_chang_dso_2100_driver_info);