X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Fconrad-digi-35-cpu%2Fapi.c;h=cfa503d52a125d86a010d476f2b5398ab04cab98;hb=d8b65ef66112f2c5dccdbe668b05e6856c00ac3d;hp=5328ccd16f8545d51c225c43a53000290f8131fa;hpb=c2fdcc25a47c4c8f25e3ea96ea36a674a151e839;p=libsigrok.git
diff --git a/src/hardware/conrad-digi-35-cpu/api.c b/src/hardware/conrad-digi-35-cpu/api.c
index 5328ccd1..cfa503d5 100644
--- a/src/hardware/conrad-digi-35-cpu/api.c
+++ b/src/hardware/conrad-digi-35-cpu/api.c
@@ -17,9 +17,12 @@
* along with this program. If not, see .
*/
-/** @file
- * Conrad DIGI 35 CPU power supply driver
- * @internal
+/**
+ * @file
+ *
+ * Conrad DIGI 35 CPU power supply driver
+ *
+ * @internal
*/
#include
@@ -39,20 +42,14 @@ static const uint32_t devopts[] = {
SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_SET,
};
-SR_PRIV struct sr_dev_driver conrad_digi_35_cpu_driver_info;
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct sr_dev_inst *sdi;
- struct drv_context *drvc;
struct sr_config *src;
struct sr_serial_dev_inst *serial;
- GSList *l, *devices;
+ GSList *l;
const char *conn, *serialcomm;
- devices = NULL;
- drvc = di->context;
- drvc->instances = NULL;
conn = serialcomm = NULL;
for (l = options; l; l = l->next) {
@@ -88,17 +85,14 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
sr_spew("Conrad DIGI 35 CPU assumed at %s.", conn);
sdi = g_malloc0(sizeof(struct sr_dev_inst));
- sdi->status = SR_ST_ACTIVE;
+ sdi->status = SR_ST_INACTIVE;
sdi->vendor = g_strdup("Conrad");
sdi->model = g_strdup("DIGI 35 CPU");
sdi->conn = serial;
sdi->priv = NULL;
- sdi->driver = di;
sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "CH1");
- drvc->instances = g_slist_append(drvc->instances, sdi);
- devices = g_slist_append(devices, sdi);
- return devices;
+ return std_scan_complete(di, g_slist_append(NULL, sdi));
}
static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
@@ -183,7 +177,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
return SR_OK;
}
-SR_PRIV struct sr_dev_driver conrad_digi_35_cpu_driver_info = {
+static struct sr_dev_driver conrad_digi_35_cpu_driver_info = {
.name = "conrad-digi-35-cpu",
.longname = "Conrad DIGI 35 CPU",
.api_version = 1,
@@ -201,3 +195,4 @@ SR_PRIV struct sr_dev_driver conrad_digi_35_cpu_driver_info = {
.dev_acquisition_stop = dev_acquisition_stop,
.context = NULL,
};
+SR_REGISTER_DEV_DRIVER(conrad_digi_35_cpu_driver_info);