X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Funi-t-ut32x%2Fapi.c;h=da53be9e6161afa10f1da758a711b76b3a8ad2a5;hb=cb4b368f17f03d03075a25b2eee1045023b973b3;hp=aed53aad337b01de5030cc2bb1d0f01247fc90c9;hpb=e32862ebccac5ae063abc68d9ce13a66ad46bb97;p=libsigrok.git diff --git a/src/hardware/uni-t-ut32x/api.c b/src/hardware/uni-t-ut32x/api.c index aed53aad..da53be9e 100644 --- a/src/hardware/uni-t-ut32x/api.c +++ b/src/hardware/uni-t-ut32x/api.c @@ -48,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) { @@ -71,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++) @@ -81,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) @@ -137,7 +134,7 @@ static int dev_close(struct sr_dev_inst *sdi) usb = sdi->conn; if (!usb->devhdl) - /* Nothing to do. */ + /* Nothing to do. */ return SR_OK; libusb_release_interface(usb->devhdl, USB_INTERFACE); @@ -257,7 +254,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_ERR; } - std_session_send_df_header(sdi, LOG_PREFIX); + std_session_send_df_header(sdi); if (!(devc->xfer = libusb_alloc_transfer(0))) return SR_ERR; @@ -300,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, @@ -318,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);