X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fikalogic-scanaplus%2Fapi.c;h=456eb58cd6279520928ef858761a222f13bb2ae6;hb=c1aae90038456a61d0f9313d34e6107c3440d3e7;hp=6e311cbd782f5e6886ed7e1821ecedf97a7f7531;hpb=4f840ce965b1c30c5ab75afecc56193cbaf5c1b3;p=libsigrok.git diff --git a/src/hardware/ikalogic-scanaplus/api.c b/src/hardware/ikalogic-scanaplus/api.c index 6e311cbd..456eb58c 100644 --- a/src/hardware/ikalogic-scanaplus/api.c +++ b/src/hardware/ikalogic-scanaplus/api.c @@ -38,11 +38,10 @@ static const uint32_t devopts[] = { /* Channels are numbered 1-9. */ static const char *channel_names[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", - NULL, }; /* Note: The IKALOGIC ScanaPLUS always samples at 100MHz. */ -static uint64_t samplerates[1] = { SR_MHZ(100) }; +static const uint64_t samplerates[1] = { SR_MHZ(100) }; SR_PRIV struct sr_dev_driver ikalogic_scanaplus_driver_info; @@ -81,7 +80,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) (void)options; - drvc = di->priv; + drvc = di->context; devices = NULL; @@ -125,9 +124,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sdi->driver = di; sdi->priv = devc; - for (i = 0; channel_names[i]; i++) - sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE, - channel_names[i]); + for (i = 0; i < ARRAY_SIZE(channel_names); i++) + sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE, channel_names[i]); devices = g_slist_append(devices, sdi); drvc->instances = g_slist_append(drvc->instances, sdi); @@ -152,7 +150,7 @@ err_free_devc: static GSList *dev_list(const struct sr_dev_driver *di) { - return ((struct drv_context *)(di->priv))->instances; + return ((struct drv_context *)(di->context))->instances; } static int dev_open(struct sr_dev_inst *sdi) @@ -422,5 +420,5 @@ SR_PRIV struct sr_dev_driver ikalogic_scanaplus_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, };