X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Funi-t-ut32x%2Fapi.c;h=bc4ad43816004da970501cf8a417a74d7679b1a0;hb=15a5bfe4815f9991a9bb532c05d6244a1818a0e4;hp=b6385705937c685c3cc5bcc763c7747e2d30dbb0;hpb=c2fdcc25a47c4c8f25e3ea96ea36a674a151e839;p=libsigrok.git diff --git a/src/hardware/uni-t-ut32x/api.c b/src/hardware/uni-t-ut32x/api.c index b6385705..bc4ad438 100644 --- a/src/hardware/uni-t-ut32x/api.c +++ b/src/hardware/uni-t-ut32x/api.c @@ -37,8 +37,6 @@ static const char *data_sources[] = { "Memory", }; -SR_PRIV struct sr_dev_driver uni_t_ut32x_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct drv_context *drvc; @@ -50,7 +48,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) const char *conn; drvc = di->context; - drvc->instances = NULL; conn = NULL; for (l = options; l; l = l->next) { @@ -73,7 +70,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sdi->status = SR_ST_INACTIVE; sdi->vendor = g_strdup(VENDOR); sdi->model = g_strdup(MODEL); - sdi->driver = di; sdi->inst_type = SR_INST_USB; sdi->conn = l->data; for (i = 0; i < ARRAY_SIZE(channel_names); i++) @@ -83,14 +79,13 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sdi->priv = devc; devc->limit_samples = 0; devc->data_source = DEFAULT_DATA_SOURCE; - drvc->instances = g_slist_append(drvc->instances, sdi); devices = g_slist_append(devices, sdi); } g_slist_free(usb_devices); } else g_slist_free_full(usb_devices, g_free); - return devices; + return std_scan_complete(di, devices); } static int dev_open(struct sr_dev_inst *sdi) @@ -302,7 +297,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi) return SR_OK; } -SR_PRIV struct sr_dev_driver uni_t_ut32x_driver_info = { +static struct sr_dev_driver uni_t_ut32x_driver_info = { .name = "uni-t-ut32x", .longname = "UNI-T UT32x", .api_version = 1, @@ -320,3 +315,4 @@ SR_PRIV struct sr_dev_driver uni_t_ut32x_driver_info = { .dev_acquisition_stop = dev_acquisition_stop, .context = NULL, }; +SR_REGISTER_DEV_DRIVER(uni_t_ut32x_driver_info);