]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/arachnid-labs-re-load-pro/api.c
Put driver pointers into special section
[libsigrok.git] / src / hardware / arachnid-labs-re-load-pro / api.c
index 203515c0fd914fa8bfd0726242b7a36103d6ffda..aeacda1046d5a1cd39a5f2ec8f703e7cee8efd35 100644 (file)
@@ -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;
@@ -129,11 +127,11 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        }
 
        sdi = g_malloc0(sizeof(struct sr_dev_inst));
-       sdi->status = SR_ST_ACTIVE;
+       sdi->status = SR_ST_INACTIVE;
        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;
 
@@ -360,7 +358,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
                std_serial_dev_close, sdi->conn, LOG_PREFIX);
 }
 
-SR_PRIV struct sr_dev_driver arachnid_labs_re_load_pro_driver_info = {
+static struct sr_dev_driver arachnid_labs_re_load_pro_driver_info = {
        .name = "arachnid-labs-re-load-pro",
        .longname = "Arachnid Labs Re:load Pro",
        .api_version = 1,
@@ -377,3 +375,4 @@ SR_PRIV struct sr_dev_driver arachnid_labs_re_load_pro_driver_info = {
        .dev_acquisition_stop = dev_acquisition_stop,
        .context = NULL,
 };
+SR_REGISTER_DEV_DRIVER(arachnid_labs_re_load_pro_driver_info);