]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/manson-hcs-3xxx/api.c
Constify a few arrays and variables.
[libsigrok.git] / src / hardware / manson-hcs-3xxx / api.c
index d3bd5e1f4a3adf24497425e19985ec279bbaa1e9..d3fb81936f83ec71489e1f9a5f52f5580783a81a 100644 (file)
@@ -52,7 +52,7 @@ static const uint32_t devopts[] = {
 };
 
 /* Note: All models have one power supply output only. */
-static struct hcs_model models[] = {
+static const struct hcs_model models[] = {
        { MANSON_HCS_3100, "HCS-3100",     "3100", { 1, 18, 0.1 }, { 0, 10,   0.10 } },
        { MANSON_HCS_3102, "HCS-3102",     "3102", { 1, 36, 0.1 }, { 0,  5,   0.01 } },
        { MANSON_HCS_3104, "HCS-3104",     "3104", { 1, 60, 0.1 }, { 0,  2.5, 0.01 } },
@@ -73,19 +73,18 @@ static struct hcs_model models[] = {
 };
 
 SR_PRIV struct sr_dev_driver manson_hcs_3xxx_driver_info;
-static struct sr_dev_driver *di = &manson_hcs_3xxx_driver_info;
 
-static int dev_clear(void)
+static int dev_clear(const struct sr_dev_driver *di)
 {
        return std_dev_clear(di, NULL);
 }
 
-static int init(struct sr_context *sr_ctx)
+static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
 {
        return std_init(sr_ctx, di, LOG_PREFIX);
 }
 
-static GSList *scan(GSList *options)
+static GSList *scan(struct sr_dev_driver *di, GSList *options)
 {
        int i, model_id;
        struct drv_context *drvc;
@@ -203,14 +202,14 @@ exit_err:
        return NULL;
 }
 
-static GSList *dev_list(void)
+static GSList *dev_list(const struct sr_dev_driver *di)
 {
        return ((struct drv_context *)(di->priv))->instances;
 }
 
-static int cleanup(void)
+static int cleanup(const struct sr_dev_driver *di)
 {
-       return dev_clear();
+       return dev_clear(di);
 }
 
 static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,