]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/motech-lps-30x/api.c
drivers: Eliminate some unnecessary vendor/model #defines.
[libsigrok.git] / src / hardware / motech-lps-30x / api.c
index be5d725660f3572f3eea76235f1d129cf48379c6..32258f4943c512d1ab9570d6545a17e29dc32390 100644 (file)
@@ -32,8 +32,6 @@ SR_PRIV int lps_query_status(struct sr_dev_inst *sdi);
 
 #define SERIALCOMM "2400/8n1/dtr=1/rts=1/flow=0"
 
-#define VENDOR_MOTECH "Motech"
-
 static const uint32_t scanopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
@@ -423,7 +421,7 @@ static GSList *do_scan(lps_modelid modelid, struct sr_dev_driver *drv, GSList *o
 
        sdi = g_malloc0(sizeof(struct sr_dev_inst));
        sdi->status = SR_ST_INACTIVE;
-       sdi->vendor = g_strdup(VENDOR_MOTECH);
+       sdi->vendor = g_strdup("Motech");
        sdi->model = g_strdup(models[modelid].modelstr);
        sdi->version = g_strdup(verstr);
        sdi->inst_type = SR_INST_SERIAL;
@@ -667,7 +665,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
                                *data = g_variant_new_strv(channel_modes, 1);
                        } else {
                                /* The other models support all modes. */
-                               *data = g_variant_new_strv(channel_modes, ARRAY_SIZE(channel_modes));
+                               *data = g_variant_new_strv(ARRAY_AND_SIZE(channel_modes));
                        }
                        return SR_OK;
                default:
@@ -682,9 +680,9 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
                if ((ch_idx == 0) || (ch_idx == 1)) /* CH1, CH2 */
-                       *data = std_gvar_array_u32(devopts_cg_ch12, ARRAY_SIZE(devopts_cg_ch12));
+                       *data = std_gvar_array_u32(ARRAY_AND_SIZE(devopts_cg_ch12));
                else /* Must be CH3 */
-                       *data = std_gvar_array_u32(devopts_cg_ch3, ARRAY_SIZE(devopts_cg_ch3));
+                       *data = std_gvar_array_u32(ARRAY_AND_SIZE(devopts_cg_ch3));
                break;
        case SR_CONF_VOLTAGE_TARGET:
                *data = std_gvar_min_max_step_array(devc->model->channels[ch_idx].voltage);