]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/lascar-el-usb/api.c
Fix #442 by renaming sr_dev_driver.priv to .context
[libsigrok.git] / src / hardware / lascar-el-usb / api.c
index 4d9ae81dfb4aa4fddab39c83eb16aa9386c22544..40a4164943282cd90e076a0b3cf8865b1169a798 100644 (file)
@@ -51,7 +51,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        GSList *usb_devices, *devices, *l;
        const char *conn;
 
-       drvc = di->priv;
+       drvc = di->context;
 
        conn = NULL;
        for (l = options; l; l = l->next) {
@@ -90,7 +90,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_open(struct sr_dev_inst *sdi)
@@ -100,7 +100,7 @@ static int dev_open(struct sr_dev_inst *sdi)
        struct sr_usb_dev_inst *usb;
        int ret;
 
-       if (!(drvc = di->priv)) {
+       if (!(drvc = di->context)) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -124,7 +124,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;
        }
@@ -148,7 +148,7 @@ static int cleanup(const struct sr_dev_driver *di)
        int ret;
        struct drv_context *drvc;
 
-       if (!(drvc = di->priv))
+       if (!(drvc = di->context))
                /* Can get called on an unused driver, doesn't matter. */
                return SR_OK;
 
@@ -206,7 +206,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;
        }
@@ -340,12 +340,12 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        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;
        }
 
-       drvc = di->priv;
+       drvc = di->context;
        devc = sdi->priv;
        usb = sdi->conn;
        devc->cb_data = cb_data;
@@ -451,7 +451,7 @@ SR_PRIV 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;
        }
@@ -483,5 +483,5 @@ SR_PRIV struct sr_dev_driver lascar_el_usb_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };