X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fcem-dt-885x%2Fapi.c;h=1e4998028294bd1532920f84c25a72ec58ea6fd1;hb=145d794facd93b182e6c85d7613ce2e6d9a66d48;hp=d91c5509b1f55fa908adb1377aad0637313b4e01;hpb=91219afc75c9aa1d0c5e2da5c03343c1e43eb6df;p=libsigrok.git diff --git a/src/hardware/cem-dt-885x/api.c b/src/hardware/cem-dt-885x/api.c index d91c5509..1e499802 100644 --- a/src/hardware/cem-dt-885x/api.c +++ b/src/hardware/cem-dt-885x/api.c @@ -67,22 +67,20 @@ static const char *data_sources[] = { "Memory", }; SR_PRIV struct sr_dev_driver cem_dt_885x_driver_info; -static struct sr_dev_driver *di = &cem_dt_885x_driver_info; -static int init(struct sr_context *sr_ctx) +static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx) { return std_init(sr_ctx, di, LOG_PREFIX); } -static GSList *scan(GSList *options) +static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct drv_context *drvc; struct dev_context *devc; struct sr_config *src; struct sr_serial_dev_inst *serial; struct sr_dev_inst *sdi; - struct sr_channel *ch; GSList *l, *devices; gint64 start; const char *conn; @@ -122,8 +120,7 @@ static GSList *scan(GSList *options) sdi->inst_type = SR_INST_SERIAL; sdi->priv = devc; sdi->driver = di; - ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "SPL"); - sdi->channels = g_slist_append(sdi->channels, ch); + sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "SPL"); drvc->instances = g_slist_append(drvc->instances, sdi); devices = g_slist_append(devices, sdi); break; @@ -137,7 +134,7 @@ static GSList *scan(GSList *options) return devices; } -static GSList *dev_list(void) +static GSList *dev_list(const struct sr_dev_driver *di) { return ((struct drv_context *)(di->priv))->instances; } @@ -155,7 +152,7 @@ static int dev_open(struct sr_dev_inst *sdi) return SR_OK; } -static int cleanup(void) +static int cleanup(const struct sr_dev_driver *di) { return std_dev_clear(di, NULL); }