]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/testo/api.c
Build: Include <config.h> first in all source files
[libsigrok.git] / src / hardware / testo / api.c
index de3faf04334198e4d882d3a46ba25b3e41659bde..6907ba4ec8023dbfc0b6891730658c6e67933d1c 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include <string.h>
 #include "protocol.h"
 
@@ -63,7 +64,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        char manufacturer[64], product[64], connection_id[64];
 
        devices = NULL;
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
 
        conn_devices = NULL;
@@ -151,7 +152,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 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_clear(const struct sr_dev_driver *di)
@@ -162,13 +163,13 @@ static int dev_clear(const struct sr_dev_driver *di)
 static int dev_open(struct sr_dev_inst *sdi)
 {
        struct sr_dev_driver *di = sdi->driver;
-       struct drv_context *drvc = di->priv;
+       struct drv_context *drvc = di->context;
        struct sr_usb_dev_inst *usb;
        libusb_device **devlist;
        int ret, i;
        char connection_id[64];
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -215,7 +216,7 @@ static int dev_close(struct sr_dev_inst *sdi)
        struct sr_dev_driver *di = sdi->driver;
        struct sr_usb_dev_inst *usb;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -238,7 +239,7 @@ static int cleanup(const struct sr_dev_driver *di)
        int ret;
        struct drv_context *drvc;
 
-       if (!(drvc = di->priv))
+       if (!(drvc = di->context))
                return SR_OK;
 
        ret = dev_clear(di);
@@ -283,7 +284,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -427,7 +428,7 @@ static int handle_events(int fd, int revents, void *cb_data)
        sdi = cb_data;
        devc = sdi->priv;
        di = sdi->driver;
-       drvc = di->priv;
+       drvc = di->context;
 
        if (devc->limit_msec) {
                now = g_get_monotonic_time() / 1000;
@@ -461,11 +462,11 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        int ret;
        unsigned char *buf;
 
-       drvc = di->priv;
+       drvc = di->context;
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -510,7 +511,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
        struct sr_dev_driver *di = sdi->driver;
        (void)cb_data;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -539,5 +540,5 @@ SR_PRIV struct sr_dev_driver testo_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };