X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhantek-dso%2Fapi.c;h=f8fdc1a4758cfbef83deeecf28771e352e19cde7;hb=e32862ebccac5ae063abc68d9ce13a66ad46bb97;hp=7faaa16613dc583780d60ab46a654402568e05e0;hpb=4d399734b4ec7affb58c5881ea1b8d88eaa57d53;p=libsigrok.git diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c index 7faaa166..f8fdc1a4 100644 --- a/src/hardware/hantek-dso/api.c +++ b/src/hardware/hantek-dso/api.c @@ -160,11 +160,10 @@ static const char *coupling[] = { "GND", }; -SR_PRIV struct sr_dev_driver hantek_dso_driver_info; - static int dev_acquisition_stop(struct sr_dev_inst *sdi); -static struct sr_dev_inst *dso_dev_new(const struct dso_profile *prof) +static struct sr_dev_inst *dso_dev_new(struct sr_dev_driver *di, + const struct dso_profile *prof) { struct sr_dev_inst *sdi; struct sr_channel *ch; @@ -177,7 +176,7 @@ static struct sr_dev_inst *dso_dev_new(const struct dso_profile *prof) sdi->status = SR_ST_INITIALIZING; sdi->vendor = g_strdup(prof->vendor); sdi->model = g_strdup(prof->model); - sdi->driver = &hantek_dso_driver_info; + sdi->driver = di; /* * Add only the real channels -- EXT isn't a source of data, only @@ -209,7 +208,7 @@ static struct sr_dev_inst *dso_dev_new(const struct dso_profile *prof) devc->triggersource = g_strdup(DEFAULT_TRIGGER_SOURCE); devc->triggerposition = DEFAULT_HORIZ_TRIGGERPOS; sdi->priv = devc; - drvc = hantek_dso_driver_info.context; + drvc = di->context; drvc->instances = g_slist_append(drvc->instances, sdi); return sdi; @@ -314,7 +313,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) /* Device matches the pre-firmware profile. */ prof = &dev_profiles[j]; sr_dbg("Found a %s %s.", prof->vendor, prof->model); - sdi = dso_dev_new(prof); + sdi = dso_dev_new(di, prof); sdi->connection_id = g_strdup(connection_id); devices = g_slist_append(devices, sdi); devc = sdi->priv; @@ -333,7 +332,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) /* Device matches the post-firmware profile. */ prof = &dev_profiles[j]; sr_dbg("Found a %s %s.", prof->vendor, prof->model); - sdi = dso_dev_new(prof); + sdi = dso_dev_new(di, prof); sdi->connection_id = g_strdup(connection_id); sdi->status = SR_ST_INACTIVE; devices = g_slist_append(devices, sdi);