X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fgmc-mh-1x-2x%2Fapi.c;h=3c0a7aaff43ba13f9ed11596604dff623113f8fd;hb=d292f767bd031979edbcbf54b7daa39b0aad7812;hp=98d200e7c8940dddc350803a59844a65ce2a5fc9;hpb=ba7dd8bbb8168cba432a844259a3e239aa5f36d7;p=libsigrok.git diff --git a/hardware/gmc-mh-1x-2x/api.c b/hardware/gmc-mh-1x-2x/api.c index 98d200e7..3c0a7aaf 100644 --- a/hardware/gmc-mh-1x-2x/api.c +++ b/hardware/gmc-mh-1x-2x/api.c @@ -224,7 +224,7 @@ static GSList *scan_1x_2x_rs232(GSList *options) if (model != METRAHIT_NONE) { sr_spew("%s %s detected!", VENDOR_GMC, gmc_model_str(model)); if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR_GMC, - gmc_model_str(model), ""))) + gmc_model_str(model), NULL))) return NULL; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { sr_err("Device context malloc failed."); @@ -240,7 +240,7 @@ static GSList *scan_1x_2x_rs232(GSList *options) sdi->conn = serial; sdi->priv = devc; sdi->driver = &gmc_mh_1x_2x_rs232_driver_info; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) + if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1"))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); drvc->instances = g_slist_append(drvc->instances, sdi); @@ -343,7 +343,7 @@ static GSList *scan_2x_bd232(GSList *options) sdi->conn = serial; sdi->priv = devc; sdi->driver = &gmc_mh_2x_bd232_driver_info; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) + if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1"))) goto exit_err; sdi->channels = g_slist_append(sdi->channels, ch); drvc->instances = g_slist_append(drvc->instances, sdi); @@ -428,14 +428,10 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, int ret; struct dev_context *devc; - (void)sdi; - (void)data; (void)cg; ret = SR_OK; - (void)cg; - if (!sdi || !(devc = sdi->priv)) return SR_ERR_ARG; @@ -447,7 +443,6 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, case SR_CONF_LIMIT_MSEC: *data = g_variant_new_uint64(devc->limit_msec); break; - case SR_CONF_POWER_OFF: *data = g_variant_new_boolean(FALSE); break; @@ -481,8 +476,6 @@ static int config_list_common(int key, GVariant **data, const struct sr_dev_inst static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { - (void)sdi; - switch (key) { case SR_CONF_DEVICE_OPTIONS: *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, @@ -499,8 +492,6 @@ static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sd static int config_list_bd(int key, GVariant **data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { - (void)sdi; - switch (key) { case SR_CONF_DEVICE_OPTIONS: *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,