X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fkecheng-kc-330b%2Fapi.c;h=57dafdfc6d6df4d4d8f7228a8c2bee1f6dae3d36;hb=13dd25bdb807217addc76e9c446485e28e6ec00a;hp=d9e647d12f682818dda54d23133db5de601cdb9e;hpb=6c60facc190a03c50aa66d4b1d17c825fec5d20e;p=libsigrok.git diff --git a/hardware/kecheng-kc-330b/api.c b/hardware/kecheng-kc-330b/api.c index d9e647d1..57dafdfc 100644 --- a/hardware/kecheng-kc-330b/api.c +++ b/hardware/kecheng-kc-330b/api.c @@ -112,7 +112,7 @@ static GSList *scan(GSList *options) struct drv_context *drvc; struct dev_context *devc; struct sr_dev_inst *sdi; - struct sr_probe *probe; + struct sr_channel *ch; GSList *usb_devices, *devices, *l; char *model; @@ -135,9 +135,9 @@ static GSList *scan(GSList *options) sdi->driver = di; sdi->inst_type = SR_INST_USB; sdi->conn = l->data; - if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "SPL"))) + if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "SPL"))) return NULL; - sdi->probes = g_slist_append(sdi->probes, probe); + sdi->channels = g_slist_append(sdi->channels, ch); if (!(devc = g_try_malloc(sizeof(struct dev_context)))) { sr_dbg("Device context malloc failed."); @@ -171,11 +171,6 @@ static GSList *dev_list(void) return ((struct drv_context *)(di->priv))->instances; } -static int dev_clear(void) -{ - return std_dev_clear(di, NULL); -} - static int dev_open(struct sr_dev_inst *sdi) { struct drv_context *drvc; @@ -245,7 +240,8 @@ static int cleanup(void) /* Can get called on an unused driver, doesn't matter. */ return SR_OK; - ret = dev_clear(); + + ret = std_dev_clear(di, NULL); g_free(drvc); di->priv = NULL; @@ -253,13 +249,13 @@ static int cleanup(void) } static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *cg) { struct dev_context *devc; GVariant *rational[2]; const uint64_t *si; - (void)probe_group; + (void)cg; devc = sdi->priv; switch (key) { @@ -302,7 +298,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *cg) { struct dev_context *devc; uint64_t p, q; @@ -310,7 +306,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, int tmp, ret; const char *tmp_str; - (void)probe_group; + (void)cg; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -382,14 +378,14 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *cg) { GVariant *tuple, *rational[2]; GVariantBuilder gvb; unsigned int i; (void)sdi; - (void)probe_group; + (void)cg; switch (key) { case SR_CONF_DEVICE_OPTIONS: @@ -567,7 +563,7 @@ SR_PRIV struct sr_dev_driver kecheng_kc_330b_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = dev_clear, + .dev_clear = NULL, .config_get = config_get, .config_set = config_set, .config_list = config_list,