]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/saleae-logic16/api.c
Put driver pointers into special section
[libsigrok.git] / src / hardware / saleae-logic16 / api.c
index 4450a22cc1e08bcf894ed1526330ec51d05c0879..95c9f9e72806ccbd097d9cd88eeecb72db54a595 100644 (file)
@@ -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,
 };
@@ -95,11 +93,6 @@ static const uint64_t samplerates[] = {
        SR_MHZ(100),
 };
 
-static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
-{
-       return std_init(sr_ctx, di, LOG_PREFIX);
-}
-
 static gboolean check_conf_profile(libusb_device *dev)
 {
        struct libusb_device_descriptor des;
@@ -235,11 +228,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 int logic16_dev_open(struct sr_dev_inst *sdi)
 {
        struct sr_dev_driver *di;
@@ -797,14 +785,14 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
        return ret;
 }
 
-SR_PRIV struct sr_dev_driver saleae_logic16_driver_info = {
+static struct sr_dev_driver saleae_logic16_driver_info = {
        .name = "saleae-logic16",
        .longname = "Saleae Logic16",
        .api_version = 1,
-       .init = init,
+       .init = std_init,
        .cleanup = std_cleanup,
        .scan = scan,
-       .dev_list = dev_list,
+       .dev_list = std_dev_list,
        .dev_clear = NULL,
        .config_get = config_get,
        .config_set = config_set,
@@ -815,3 +803,4 @@ SR_PRIV struct sr_dev_driver saleae_logic16_driver_info = {
        .dev_acquisition_stop = dev_acquisition_stop,
        .context = NULL,
 };
+SR_REGISTER_DEV_DRIVER(saleae_logic16_driver_info);