From: Soeren Apel Date: Mon, 6 Jul 2015 19:55:36 +0000 (+0200) Subject: Fix #442 by renaming sr_dev_driver.priv to .context X-Git-Tag: libsigrok-0.4.0~462 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=41812aca436805b0614f2a8f31cf2f8ce494aea0;p=libsigrok.git Fix #442 by renaming sr_dev_driver.priv to .context --- diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index 3ac46f6b..233e04a6 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -1073,8 +1073,8 @@ struct sr_dev_driver { void *cb_data); /* Dynamic */ - /** Device driver private data. Initialized by init(). */ - void *priv; + /** Device driver context, considered private. Initialized by init(). */ + void *context; }; /** diff --git a/src/device.c b/src/device.c index d7c32567..01f41348 100644 --- a/src/device.c +++ b/src/device.c @@ -547,7 +547,7 @@ SR_API const char *sr_dev_inst_connid_get(const struct sr_dev_inst *sdi) if ((!sdi->connection_id) && (sdi->inst_type == SR_INST_USB)) { /* connection_id isn't populated, let's do that here. */ - drvc = sdi->driver->priv; + drvc = sdi->driver->context; usb = sdi->conn; if ((cnt = libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist)) < 0) { diff --git a/src/hardware/agilent-dmm/api.c b/src/hardware/agilent-dmm/api.c index e8ef427b..82374076 100644 --- a/src/hardware/agilent-dmm/api.c +++ b/src/hardware/agilent-dmm/api.c @@ -89,7 +89,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) const char *conn, *serialcomm; char *buf, **tokens; - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; devices = NULL; @@ -163,7 +163,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 cleanup(const struct sr_dev_driver *di) @@ -275,5 +275,5 @@ SR_PRIV struct sr_dev_driver agdmm_driver_info = { .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/appa-55ii/api.c b/src/hardware/appa-55ii/api.c index 18fc2142..580dbc2a 100644 --- a/src/hardware/appa-55ii/api.c +++ b/src/hardware/appa-55ii/api.c @@ -86,7 +86,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sr_info("Probing serial port %s.", conn); - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; serial_flush(serial); @@ -122,7 +122,7 @@ scan_cleanup: 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 cleanup(const struct sr_dev_driver *di) @@ -281,5 +281,5 @@ SR_PRIV struct sr_dev_driver appa_55ii_driver_info = { .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/asix-sigma/asix-sigma.c b/src/hardware/asix-sigma/asix-sigma.c index 6e7f1fd7..0a2ec990 100644 --- a/src/hardware/asix-sigma/asix-sigma.c +++ b/src/hardware/asix-sigma/asix-sigma.c @@ -345,7 +345,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) (void)options; - drvc = di->priv; + drvc = di->context; devices = NULL; @@ -411,7 +411,7 @@ free: static GSList *dev_list(const struct sr_dev_driver *di) { - return ((struct drv_context *)(di->priv))->instances; + return ((struct drv_context *)(di->context))->instances; } /* @@ -1554,5 +1554,5 @@ SR_PRIV struct sr_dev_driver asix_sigma_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/atten-pps3xxx/api.c b/src/hardware/atten-pps3xxx/api.c index 6b178ae9..10dfa2ad 100644 --- a/src/hardware/atten-pps3xxx/api.c +++ b/src/hardware/atten-pps3xxx/api.c @@ -100,7 +100,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options, int modelid) char channel[10]; devices = NULL; - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; conn = serialcomm = NULL; @@ -201,7 +201,7 @@ static GSList *scan_3203(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 cleanup(const struct sr_dev_driver *di) @@ -523,5 +523,5 @@ SR_PRIV struct sr_dev_driver atten_pps3203_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/baylibre-acme/api.c b/src/hardware/baylibre-acme/api.c index 6cbae388..b1884b62 100644 --- a/src/hardware/baylibre-acme/api.c +++ b/src/hardware/baylibre-acme/api.c @@ -68,7 +68,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) (void)options; - drvc = di->priv; + drvc = di->context; devices = NULL; devc = g_malloc0(sizeof(struct dev_context)); @@ -143,7 +143,7 @@ err_out: 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) @@ -442,5 +442,5 @@ SR_PRIV struct sr_dev_driver baylibre_acme_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/beaglelogic/api.c b/src/hardware/beaglelogic/api.c index 5f1d35fc..12af5c1d 100644 --- a/src/hardware/beaglelogic/api.c +++ b/src/hardware/beaglelogic/api.c @@ -87,7 +87,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) int i, maxch; devices = NULL; - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; /* Probe for /dev/beaglelogic */ @@ -146,7 +146,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) @@ -205,7 +205,7 @@ static int cleanup(const struct sr_dev_driver *di) GSList *l; /* unused driver */ - if (!(drvc = di->priv)) + if (!(drvc = di->context)) return SR_OK; /* Clean up the instances */ @@ -422,5 +422,5 @@ SR_PRIV struct sr_dev_driver beaglelogic_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/brymen-bm86x/api.c b/src/hardware/brymen-bm86x/api.c index d7dccc05..834f11bb 100644 --- a/src/hardware/brymen-bm86x/api.c +++ b/src/hardware/brymen-bm86x/api.c @@ -49,7 +49,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) struct sr_config *src; const char *conn; - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; conn = BRYMEN_BC86X; @@ -93,13 +93,13 @@ 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) { 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; struct dev_context *devc; int ret; @@ -299,5 +299,5 @@ SR_PRIV struct sr_dev_driver brymen_bm86x_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/brymen-dmm/api.c b/src/hardware/brymen-dmm/api.c index 38a5ab8f..b1c5339c 100644 --- a/src/hardware/brymen-dmm/api.c +++ b/src/hardware/brymen-dmm/api.c @@ -80,7 +80,7 @@ static GSList *brymen_scan(const char *conn, const char *serialcomm) devc = g_malloc0(sizeof(struct dev_context)); sdi->inst_type = SR_INST_SERIAL; sdi->conn = serial; - drvc = di->priv; + drvc = di->context; sdi->priv = devc; sdi->driver = di; sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "P1"); @@ -101,7 +101,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) const char *conn, *serialcomm; devices = NULL; - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; conn = serialcomm = NULL; @@ -132,7 +132,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 cleanup(const struct sr_dev_driver *di) @@ -249,5 +249,5 @@ SR_PRIV struct sr_dev_driver brymen_bm857_driver_info = { .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/cem-dt-885x/api.c b/src/hardware/cem-dt-885x/api.c index a30b5b77..ebeebcf2 100644 --- a/src/hardware/cem-dt-885x/api.c +++ b/src/hardware/cem-dt-885x/api.c @@ -102,7 +102,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) return NULL; devices = NULL; - drvc = di->priv; + drvc = di->context; start = g_get_monotonic_time(); while (g_get_monotonic_time() - start < MAX_SCAN_TIME_US) { if (serial_read_nonblocking(serial, &c, 1) == 1 && c == 0xa5) { @@ -137,7 +137,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) @@ -431,5 +431,5 @@ SR_PRIV struct sr_dev_driver cem_dt_885x_driver_info = { .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/center-3xx/api.c b/src/hardware/center-3xx/api.c index 1d2a5669..b041db82 100644 --- a/src/hardware/center-3xx/api.c +++ b/src/hardware/center-3xx/api.c @@ -79,7 +79,7 @@ static GSList *center_scan(const char *conn, const char *serialcomm, int idx) if (serial_open(serial, SERIAL_RDWR) != SR_OK) return NULL; - drvc = center_devs[idx].di->priv; + drvc = center_devs[idx].di->context; devices = NULL; serial_flush(serial); @@ -140,7 +140,7 @@ static GSList *scan(GSList *options, int idx) static GSList *dev_list(int idx) { - return ((struct drv_context *)(center_devs[idx].di->priv))->instances; + return ((struct drv_context *)(center_devs[idx].di->context))->instances; } static int cleanup(int idx) @@ -278,7 +278,7 @@ SR_PRIV struct sr_dev_driver ID##_driver_info = { \ .dev_close = std_serial_dev_close, \ .dev_acquisition_start = dev_acquisition_start_##ID_UPPER, \ .dev_acquisition_stop = dev_acquisition_stop, \ - .priv = NULL, \ + .context = NULL, \ }; DRV(center_309, CENTER_309, "center-309", "Center 309") diff --git a/src/hardware/chronovu-la/api.c b/src/hardware/chronovu-la/api.c index fc5212f4..c4cc2ab0 100644 --- a/src/hardware/chronovu-la/api.c +++ b/src/hardware/chronovu-la/api.c @@ -83,7 +83,7 @@ static int add_device(int idx, int model, GSList **devices) ret = SR_OK; - drvc = di->priv; + drvc = di->context; /* Allocate memory for our private device context. */ devc = g_malloc0(sizeof(struct dev_context)); @@ -191,7 +191,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) @@ -542,5 +542,5 @@ SR_PRIV struct sr_dev_driver chronovu_la_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/colead-slm/api.c b/src/hardware/colead-slm/api.c index a6044401..38c54580 100644 --- a/src/hardware/colead-slm/api.c +++ b/src/hardware/colead-slm/api.c @@ -58,7 +58,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) GSList *devices, *l; const char *conn, *serialcomm; - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; devices = NULL; @@ -98,7 +98,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) @@ -219,5 +219,5 @@ SR_PRIV struct sr_dev_driver colead_slm_driver_info = { .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/conrad-digi-35-cpu/api.c b/src/hardware/conrad-digi-35-cpu/api.c index ee42960a..5af4b051 100644 --- a/src/hardware/conrad-digi-35-cpu/api.c +++ b/src/hardware/conrad-digi-35-cpu/api.c @@ -55,7 +55,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) const char *conn, *serialcomm; devices = NULL; - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; conn = serialcomm = NULL; @@ -107,7 +107,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 cleanup(const struct sr_dev_driver *di) @@ -218,5 +218,5 @@ SR_PRIV struct sr_dev_driver conrad_digi_35_cpu_driver_info = { .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/demo/demo.c b/src/hardware/demo/demo.c index 5128b9dc..4ad4ea34 100644 --- a/src/hardware/demo/demo.c +++ b/src/hardware/demo/demo.c @@ -278,7 +278,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) int num_logic_channels, num_analog_channels, pattern, i; char channel_name[16]; - drvc = di->priv; + drvc = di->context; num_logic_channels = DEFAULT_NUM_LOGIC_CHANNELS; num_analog_channels = DEFAULT_NUM_ANALOG_CHANNELS; @@ -370,7 +370,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) @@ -925,5 +925,5 @@ SR_PRIV struct sr_dev_driver demo_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/deree-de5000/api.c b/src/hardware/deree-de5000/api.c index 88aa8828..33e38881 100644 --- a/src/hardware/deree-de5000/api.c +++ b/src/hardware/deree-de5000/api.c @@ -28,7 +28,7 @@ static void std_dev_attach(struct sr_dev_driver *di, struct sr_dev_inst *sdi) { struct drv_context *drvc; - drvc = di->priv; + drvc = di->context; sdi->driver = di; drvc->instances = g_slist_append(drvc->instances, sdi); @@ -36,7 +36,7 @@ static void std_dev_attach(struct sr_dev_driver *di, struct sr_dev_inst *sdi) static GSList *dev_list(const struct sr_dev_driver *di) { - return ((struct drv_context *)di->priv)->instances; + return ((struct drv_context *)di->context)->instances; } #define LOG_PREFIX "deree-de5000" @@ -81,5 +81,5 @@ SR_PRIV struct sr_dev_driver deree_de5000_driver_info = { .dev_close = std_serial_dev_close, .dev_acquisition_start = es51919_serial_acquisition_start, .dev_acquisition_stop = es51919_serial_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/fluke-dmm/api.c b/src/hardware/fluke-dmm/api.c index 4c6e2c18..1b4ce404 100644 --- a/src/hardware/fluke-dmm/api.c +++ b/src/hardware/fluke-dmm/api.c @@ -79,7 +79,7 @@ static GSList *fluke_scan(struct sr_dev_driver *di, const char *conn, if (serial_open(serial, SERIAL_RDWR) != SR_OK) return NULL; - drvc = di->priv; + drvc = di->context; b = buf; retry = 0; devices = NULL; @@ -190,7 +190,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 cleanup(const struct sr_dev_driver *di) @@ -305,5 +305,5 @@ SR_PRIV struct sr_dev_driver flukedmm_driver_info = { .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/fx2lafw/api.c b/src/hardware/fx2lafw/api.c index ada4fcc9..4348e680 100644 --- a/src/hardware/fx2lafw/api.c +++ b/src/hardware/fx2lafw/api.c @@ -193,7 +193,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) const char *conn; char manufacturer[64], product[64], serial_num[64], connection_id[64]; - drvc = di->priv; + drvc = di->context; conn = NULL; for (l = options; l; l = l->next) { @@ -355,7 +355,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) @@ -468,7 +468,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 = std_dev_clear(di, NULL); @@ -764,7 +764,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) return SR_ERR_DEV_CLOSED; di = sdi->driver; - drvc = di->priv; + drvc = di->context; devc = sdi->priv; devc->ctx = drvc->sr_ctx; @@ -815,5 +815,5 @@ SR_PRIV struct sr_dev_driver fx2lafw_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/fx2lafw/protocol.c b/src/hardware/fx2lafw/protocol.c index 6098f24e..c87f659d 100644 --- a/src/hardware/fx2lafw/protocol.c +++ b/src/hardware/fx2lafw/protocol.c @@ -194,7 +194,7 @@ SR_PRIV int fx2lafw_dev_open(struct sr_dev_inst *sdi, struct sr_dev_driver *di) uint8_t revid; char connection_id[64]; - drvc = di->priv; + drvc = di->context; devc = sdi->priv; usb = sdi->conn; diff --git a/src/hardware/gmc-mh-1x-2x/api.c b/src/hardware/gmc-mh-1x-2x/api.c index efb9e009..890fec47 100644 --- a/src/hardware/gmc-mh-1x-2x/api.c +++ b/src/hardware/gmc-mh-1x-2x/api.c @@ -161,7 +161,7 @@ static GSList *scan_1x_2x_rs232(struct sr_dev_driver *di, GSList *options) gboolean serialcomm_given; devices = NULL; - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; conn = serialcomm = NULL; model = METRAHIT_NONE; @@ -256,7 +256,7 @@ static GSList *scan_2x_bd232(struct sr_dev_driver *di, GSList *options) conn = serialcomm = NULL; devices = NULL; - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; sr_spew("scan_2x_bd232() called!"); @@ -354,7 +354,7 @@ exit_err: 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_close(struct sr_dev_inst *sdi) @@ -551,7 +551,7 @@ SR_PRIV struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start_1x_2x_rs232, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; SR_PRIV struct sr_dev_driver gmc_mh_2x_bd232_driver_info = { @@ -570,5 +570,5 @@ SR_PRIV struct sr_dev_driver gmc_mh_2x_bd232_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start_2x_bd232, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/hameg-hmo/api.c b/src/hardware/hameg-hmo/api.c index cad91c75..fb03d04c 100644 --- a/src/hardware/hameg-hmo/api.c +++ b/src/hardware/hameg-hmo/api.c @@ -116,12 +116,12 @@ fail: static GSList *scan(struct sr_dev_driver *di, GSList *options) { - return sr_scpi_scan(di->priv, options, hmo_probe_serial_device); + return sr_scpi_scan(di->context, options, hmo_probe_serial_device); } 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 void clear_helper(void *priv) @@ -809,5 +809,5 @@ SR_PRIV struct sr_dev_driver hameg_hmo_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c index 47907d8e..b309ea66 100644 --- a/src/hardware/hantek-dso/api.c +++ b/src/hardware/hantek-dso/api.c @@ -208,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.priv; + drvc = hantek_dso_driver_info.context; drvc->instances = g_slist_append(drvc->instances, sdi); return sdi; @@ -273,7 +273,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) const char *conn; char connection_id[64]; - drvc = di->priv; + drvc = di->context; devices = 0; @@ -363,7 +363,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) @@ -876,7 +876,7 @@ static int handle_event(int fd, int revents, void *cb_data) sdi = cb_data; di = sdi->driver; - drvc = di->priv; + drvc = di->context; devc = sdi->priv; if (devc->dev_state == STOPPING) { /* We've been told to wind up the acquisition. */ @@ -976,7 +976,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) { struct dev_context *devc; struct sr_dev_driver *di = sdi->driver; - struct drv_context *drvc = di->priv; + struct drv_context *drvc = di->context; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -1035,5 +1035,5 @@ SR_PRIV struct sr_dev_driver hantek_dso_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/hantek-dso/dso.c b/src/hardware/hantek-dso/dso.c index 156efd93..195201fe 100644 --- a/src/hardware/hantek-dso/dso.c +++ b/src/hardware/hantek-dso/dso.c @@ -111,7 +111,7 @@ err: SR_PRIV int dso_open(struct sr_dev_inst *sdi) { struct dev_context *devc; - struct drv_context *drvc = hantek_dso_driver_info.priv; + struct drv_context *drvc = hantek_dso_driver_info.context; struct sr_usb_dev_inst *usb; struct libusb_device_descriptor des; libusb_device **devlist; diff --git a/src/hardware/ikalogic-scanalogic2/api.c b/src/hardware/ikalogic-scanalogic2/api.c index a18557cf..92b9946a 100644 --- a/src/hardware/ikalogic-scanalogic2/api.c +++ b/src/hardware/ikalogic-scanalogic2/api.c @@ -72,7 +72,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) (void)options; devices = NULL; - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; usb_devices = sr_usb_find(drvc->sr_ctx->libusb_ctx, USB_VID_PID); @@ -163,7 +163,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 void clear_dev_context(void *priv) @@ -193,7 +193,7 @@ static int dev_open(struct sr_dev_inst *sdi) uint8_t buffer[PACKET_LENGTH]; int ret; - if (!(drvc = di->priv)) { + if (!(drvc = di->context)) { sr_err("Driver was not initialized."); return SR_ERR; } @@ -261,7 +261,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; } @@ -397,7 +397,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) return SR_ERR_DEV_CLOSED; devc = sdi->priv; - drvc = di->priv; + drvc = di->context; devc->cb_data = cb_data; devc->wait_data_ready_locked = TRUE; @@ -505,5 +505,5 @@ SR_PRIV struct sr_dev_driver ikalogic_scanalogic2_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/ikalogic-scanalogic2/protocol.c b/src/hardware/ikalogic-scanalogic2/protocol.c index 7a7a2cb1..70ef2809 100644 --- a/src/hardware/ikalogic-scanalogic2/protocol.c +++ b/src/hardware/ikalogic-scanalogic2/protocol.c @@ -215,7 +215,7 @@ SR_PRIV int ikalogic_scanalogic2_receive_data(int fd, int revents, void *cb_data return TRUE; di = sdi->driver; - drvc = di->priv; + drvc = di->context; current_time = g_get_monotonic_time(); if (devc->state == STATE_WAIT_DATA_READY && @@ -643,7 +643,7 @@ SR_PRIV int sl2_get_device_info(struct sr_usb_dev_inst usb, uint8_t buffer[PACKET_LENGTH]; int ret; - drvc = ikalogic_scanalogic2_driver_info.priv; + drvc = ikalogic_scanalogic2_driver_info.context; if (!dev_info) return SR_ERR_ARG; diff --git a/src/hardware/ikalogic-scanaplus/api.c b/src/hardware/ikalogic-scanaplus/api.c index 487fc217..456eb58c 100644 --- a/src/hardware/ikalogic-scanaplus/api.c +++ b/src/hardware/ikalogic-scanaplus/api.c @@ -80,7 +80,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) (void)options; - drvc = di->priv; + drvc = di->context; devices = NULL; @@ -150,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) @@ -420,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, }; diff --git a/src/hardware/kecheng-kc-330b/api.c b/src/hardware/kecheng-kc-330b/api.c index 8033e960..e7bb5a21 100644 --- a/src/hardware/kecheng-kc-330b/api.c +++ b/src/hardware/kecheng-kc-330b/api.c @@ -74,7 +74,7 @@ static int scan_kecheng(struct sr_dev_driver *di, int len, ret; unsigned char cmd, buf[32]; - drvc = di->priv; + drvc = di->context; if (sr_usb_open(drvc->sr_ctx->libusb_ctx, usb) != SR_OK) return SR_ERR; @@ -117,7 +117,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) (void)options; - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; devices = NULL; @@ -161,7 +161,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) @@ -171,7 +171,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; } @@ -201,7 +201,7 @@ static int dev_close(struct sr_dev_inst *sdi) struct dev_context *devc; struct sr_usb_dev_inst *usb; - if (!di->priv) { + if (!di->context) { sr_err("Driver was not initialized."); return SR_ERR; } @@ -231,7 +231,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; @@ -305,7 +305,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; } @@ -430,7 +430,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; - drvc = di->priv; + drvc = di->context; devc = sdi->priv; usb = sdi->conn; @@ -566,5 +566,5 @@ SR_PRIV struct sr_dev_driver kecheng_kc_330b_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/kecheng-kc-330b/protocol.c b/src/hardware/kecheng-kc-330b/protocol.c index 005b87cb..d79a92a5 100644 --- a/src/hardware/kecheng-kc-330b/protocol.c +++ b/src/hardware/kecheng-kc-330b/protocol.c @@ -44,7 +44,7 @@ SR_PRIV int kecheng_kc_330b_handle_events(int fd, int revents, void *cb_data) devc = sdi->priv; usb = sdi->conn; di = sdi->driver; - drvc = di->priv; + drvc = di->context; memset(&tv, 0, sizeof(struct timeval)); libusb_handle_events_timeout_completed(drvc->sr_ctx->libusb_ctx, &tv, diff --git a/src/hardware/lascar-el-usb/api.c b/src/hardware/lascar-el-usb/api.c index 4d9ae81d..40a41649 100644 --- a/src/hardware/lascar-el-usb/api.c +++ b/src/hardware/lascar-el-usb/api.c @@ -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, }; diff --git a/src/hardware/lascar-el-usb/protocol.c b/src/hardware/lascar-el-usb/protocol.c index cc40bbfa..3dad7943 100644 --- a/src/hardware/lascar-el-usb/protocol.c +++ b/src/hardware/lascar-el-usb/protocol.c @@ -96,7 +96,7 @@ SR_PRIV int lascar_get_config(libusb_device_handle *dev_hdl, sr_spew("Reading config block."); - drvc = di->priv; + drvc = di->context; *configlen = 0; if (!(xfer_in = libusb_alloc_transfer(0)) || @@ -213,7 +213,7 @@ static int lascar_save_config(libusb_device_handle *dev_hdl, sr_spew("Writing config block."); - drvc = di->priv; + drvc = di->context; if (!(xfer_in = libusb_alloc_transfer(0)) || !(xfer_out = libusb_alloc_transfer(0))) @@ -356,7 +356,7 @@ SR_PRIV struct sr_dev_inst *lascar_scan(int bus, int address) int dummy, ret, i; unsigned char config[MAX_CONFIGBLOCK_SIZE]; - drvc = di->priv; + drvc = di->context; sdi = NULL; libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist); @@ -479,7 +479,7 @@ static void lascar_el_usb_dispatch(struct sr_dev_inst *sdi, unsigned char *buf, SR_PRIV int lascar_el_usb_handle_events(int fd, int revents, void *cb_data) { - struct drv_context *drvc = di->priv; + struct drv_context *drvc = di->context; struct sr_datafeed_packet packet; struct sr_dev_inst *sdi; struct timeval tv; diff --git a/src/hardware/link-mso19/api.c b/src/hardware/link-mso19/api.c index 7d0fbf8b..8b4ccc7f 100644 --- a/src/hardware/link-mso19/api.c +++ b/src/hardware/link-mso19/api.c @@ -60,7 +60,7 @@ static int dev_clear(const struct sr_dev_driver *di) struct dev_context *devc; int ret = SR_OK; - if (!(drvc = di->priv)) + if (!(drvc = di->context)) return SR_OK; /* Properly close and free all devices. */ @@ -219,7 +219,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) } //Add the driver - struct drv_context *drvc = di->priv; + struct drv_context *drvc = di->context; drvc->instances = g_slist_append(drvc->instances, sdi); devices = g_slist_append(devices, sdi); } @@ -229,7 +229,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) @@ -483,5 +483,5 @@ SR_PRIV struct sr_dev_driver link_mso19_driver_info = { .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/link-mso19/protocol.c b/src/hardware/link-mso19/protocol.c index 148f0ba1..ca85ffaf 100644 --- a/src/hardware/link-mso19/protocol.c +++ b/src/hardware/link-mso19/protocol.c @@ -357,7 +357,7 @@ SR_PRIV int mso_receive_data(int fd, int revents, void *cb_data) GSList *l; int i; - struct drv_context *drvc = di->priv; + struct drv_context *drvc = di->context; /* Find this device's devc struct by its fd. */ struct dev_context *devc = NULL; diff --git a/src/hardware/manson-hcs-3xxx/api.c b/src/hardware/manson-hcs-3xxx/api.c index ccf1bf96..81370e9f 100644 --- a/src/hardware/manson-hcs-3xxx/api.c +++ b/src/hardware/manson-hcs-3xxx/api.c @@ -96,7 +96,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) struct sr_serial_dev_inst *serial; char reply[50], **tokens, *dummy; - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; devices = NULL; conn = NULL; @@ -204,7 +204,7 @@ exit_err: 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 cleanup(const struct sr_dev_driver *di) @@ -433,5 +433,5 @@ SR_PRIV struct sr_dev_driver manson_hcs_3xxx_driver_info = { .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/maynuo-m97/api.c b/src/hardware/maynuo-m97/api.c index f1afdfe6..3910100a 100644 --- a/src/hardware/maynuo-m97/api.c +++ b/src/hardware/maynuo-m97/api.c @@ -188,7 +188,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) if (!g_slist_find_custom(options, &default_modbusaddr, config_compare)) opts = g_slist_prepend(opts, &default_modbusaddr); - devices = sr_modbus_scan(di->priv, opts, probe_device); + devices = sr_modbus_scan(di->context, opts, probe_device); while (opts != options) opts = g_slist_delete_link(opts, opts); @@ -200,7 +200,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) @@ -516,5 +516,5 @@ SR_PRIV struct sr_dev_driver maynuo_m97_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/mic-985xx/api.c b/src/hardware/mic-985xx/api.c index 6abc09ce..94e8e89c 100644 --- a/src/hardware/mic-985xx/api.c +++ b/src/hardware/mic-985xx/api.c @@ -79,7 +79,7 @@ static GSList *mic_scan(const char *conn, const char *serialcomm, int idx) if (serial_open(serial, SERIAL_RDWR) != SR_OK) return NULL; - drvc = mic_devs[idx].di->priv; + drvc = mic_devs[idx].di->context; devices = NULL; serial_flush(serial); @@ -146,7 +146,7 @@ static GSList *scan(GSList *options, int idx) static GSList *dev_list(int idx) { - return ((struct drv_context *)(mic_devs[idx].di->priv))->instances; + return ((struct drv_context *)(mic_devs[idx].di->context))->instances; } static int cleanup(int idx) @@ -291,7 +291,7 @@ SR_PRIV struct sr_dev_driver ID##_driver_info = { \ .dev_close = std_serial_dev_close, \ .dev_acquisition_start = dev_acquisition_start_##ID_UPPER, \ .dev_acquisition_stop = dev_acquisition_stop, \ - .priv = NULL, \ + .context = NULL, \ }; DRV(mic_98581, MIC_98581, "mic-98581", "MIC 98581") diff --git a/src/hardware/motech-lps-30x/api.c b/src/hardware/motech-lps-30x/api.c index 30fc62f2..19f530de 100644 --- a/src/hardware/motech-lps-30x/api.c +++ b/src/hardware/motech-lps-30x/api.c @@ -516,7 +516,7 @@ static GSList *scan_lps301(struct sr_dev_driver *di, GSList *options) static GSList *dev_list_lps301(const struct sr_dev_driver *di) { - return ((struct drv_context *)(di->priv))->instances; + return ((struct drv_context *)(di->context))->instances; } static void dev_clear_private(struct dev_context* devc) @@ -849,5 +849,5 @@ SR_PRIV struct sr_dev_driver motech_lps_301_driver_info = { .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/norma-dmm/api.c b/src/hardware/norma-dmm/api.c index 2743c234..c86f9c7d 100644 --- a/src/hardware/norma-dmm/api.c +++ b/src/hardware/norma-dmm/api.c @@ -175,7 +175,7 @@ static GSList *scan(struct sr_dev_driver* drv, 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_close(struct sr_dev_inst *sdi) @@ -307,7 +307,7 @@ SR_PRIV struct sr_dev_driver norma_dmm_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; SR_PRIV struct sr_dev_driver siemens_b102x_driver_info = { @@ -326,5 +326,5 @@ SR_PRIV struct sr_dev_driver siemens_b102x_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/openbench-logic-sniffer/api.c b/src/hardware/openbench-logic-sniffer/api.c index 246b900a..4abc929a 100644 --- a/src/hardware/openbench-logic-sniffer/api.c +++ b/src/hardware/openbench-logic-sniffer/api.c @@ -105,7 +105,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) const char *conn, *serialcomm; char buf[8]; - drvc = di->priv; + drvc = di->context; devices = NULL; @@ -215,7 +215,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 cleanup(const struct sr_dev_driver *di) @@ -608,5 +608,5 @@ SR_PRIV struct sr_dev_driver ols_driver_info = { .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/pipistrello-ols/api.c b/src/hardware/pipistrello-ols/api.c index b84ff193..3c7fc7b1 100644 --- a/src/hardware/pipistrello-ols/api.c +++ b/src/hardware/pipistrello-ols/api.c @@ -93,7 +93,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) (void)options; - drvc = di->priv; + drvc = di->context; devices = NULL; @@ -201,7 +201,7 @@ err_free_ftdi_buf: 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 void clear_helper(void *priv) @@ -739,5 +739,5 @@ SR_PRIV struct sr_dev_driver p_ols_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/rigol-ds/api.c b/src/hardware/rigol-ds/api.c index 7a195bb7..3febe605 100644 --- a/src/hardware/rigol-ds/api.c +++ b/src/hardware/rigol-ds/api.c @@ -407,12 +407,12 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi) static GSList *scan(struct sr_dev_driver *di, GSList *options) { - return sr_scpi_scan(di->priv, options, probe_device); + return sr_scpi_scan(di->context, options, probe_device); } 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) @@ -1091,5 +1091,5 @@ SR_PRIV struct sr_dev_driver rigol_ds_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/saleae-logic16/api.c b/src/hardware/saleae-logic16/api.c index 868348c5..7206c582 100644 --- a/src/hardware/saleae-logic16/api.c +++ b/src/hardware/saleae-logic16/api.c @@ -152,7 +152,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) const char *conn; char connection_id[64]; - drvc = di->priv; + drvc = di->context; conn = NULL; for (l = options; l; l = l->next) { @@ -242,7 +242,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 logic16_dev_open(struct sr_dev_inst *sdi) @@ -256,7 +256,7 @@ static int logic16_dev_open(struct sr_dev_inst *sdi) char connection_id[64]; di = sdi->driver; - drvc = di->priv; + drvc = di->context; usb = sdi->conn; if (sdi->status == SR_ST_ACTIVE) @@ -416,7 +416,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; @@ -687,7 +687,7 @@ static int receive_data(int fd, int revents, void *cb_data) sdi = cb_data; di = sdi->driver; - drvc = di->priv; + drvc = di->context; devc = sdi->priv; tv.tv_sec = tv.tv_usec = 0; @@ -717,7 +717,7 @@ 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; - drvc = di->priv; + drvc = di->context; devc = sdi->priv; usb = sdi->conn; @@ -845,5 +845,5 @@ SR_PRIV struct sr_dev_driver saleae_logic16_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/scpi-pps/api.c b/src/hardware/scpi-pps/api.c index c728f2b0..e2c15ac8 100644 --- a/src/hardware/scpi-pps/api.c +++ b/src/hardware/scpi-pps/api.c @@ -173,12 +173,12 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi) static GSList *scan(struct sr_dev_driver *di, GSList *options) { - return sr_scpi_scan(di->priv, options, probe_device); + return sr_scpi_scan(di->context, options, probe_device); } 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) @@ -620,5 +620,5 @@ SR_PRIV struct sr_dev_driver scpi_pps_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/serial-dmm/api.c b/src/hardware/serial-dmm/api.c index d76d8842..5a89b3d1 100644 --- a/src/hardware/serial-dmm/api.c +++ b/src/hardware/serial-dmm/api.c @@ -92,7 +92,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sr_info("Probing serial port %s.", conn); - drvc = di->priv; + drvc = di->context; devices = NULL; serial_flush(serial); @@ -152,7 +152,7 @@ scan_cleanup: 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 cleanup(const struct sr_dev_driver *di) @@ -270,7 +270,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) .dev_close = std_serial_dev_close, \ .dev_acquisition_start = dev_acquisition_start, \ .dev_acquisition_stop = dev_acquisition_stop, \ - .priv = NULL, \ + .context = NULL, \ }, \ VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, TIMEOUT, DELAY, \ REQUEST, VALID, PARSE, DETAILS, sizeof(struct CHIPSET##_info) \ diff --git a/src/hardware/sysclk-lwla/api.c b/src/hardware/sysclk-lwla/api.c index 1d68ba4a..f5a6d2f1 100644 --- a/src/hardware/sysclk-lwla/api.c +++ b/src/hardware/sysclk-lwla/api.c @@ -118,7 +118,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) struct sr_config *src; const char *conn; - drvc = di->priv; + drvc = di->context; conn = USB_VID_PID; for (node = options; node != NULL; node = node->next) { @@ -158,7 +158,7 @@ static GSList *dev_list(const struct sr_dev_driver *di) { struct drv_context *drvc; - drvc = di->priv; + drvc = di->context; return drvc->instances; } @@ -186,7 +186,7 @@ static int dev_open(struct sr_dev_inst *sdi) struct sr_usb_dev_inst *usb; int ret; - drvc = di->priv; + drvc = di->context; if (!drvc) { sr_err("Driver was not initialized."); @@ -220,7 +220,7 @@ static int dev_close(struct sr_dev_inst *sdi) { struct sr_usb_dev_inst *usb; - if (!di->priv) { + if (!di->context) { sr_err("Driver was not initialized."); return SR_ERR; } @@ -482,7 +482,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) return SR_ERR_DEV_CLOSED; devc = sdi->priv; - drvc = di->priv; + drvc = di->context; if (devc->acquisition) { sr_err("Acquisition still in progress?"); @@ -557,5 +557,5 @@ SR_PRIV struct sr_dev_driver sysclk_lwla_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/teleinfo/api.c b/src/hardware/teleinfo/api.c index 13465f56..26f3a41a 100644 --- a/src/hardware/teleinfo/api.c +++ b/src/hardware/teleinfo/api.c @@ -79,7 +79,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sr_info("Probing serial port %s.", conn); - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; serial_flush(serial); @@ -134,7 +134,7 @@ scan_cleanup: 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 cleanup(const struct sr_dev_driver *di) @@ -248,5 +248,5 @@ SR_PRIV struct sr_dev_driver teleinfo_driver_info = { .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/testo/api.c b/src/hardware/testo/api.c index de3faf04..0ac6a32c 100644 --- a/src/hardware/testo/api.c +++ b/src/hardware/testo/api.c @@ -63,7 +63,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 +151,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 +162,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 +215,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 +238,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 +283,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 +427,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 +461,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 +510,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 +539,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, }; diff --git a/src/hardware/tondaj-sl-814/api.c b/src/hardware/tondaj-sl-814/api.c index 01c33640..83312249 100644 --- a/src/hardware/tondaj-sl-814/api.c +++ b/src/hardware/tondaj-sl-814/api.c @@ -54,7 +54,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) const char *conn, *serialcomm; struct sr_serial_dev_inst *serial; - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; devices = NULL; @@ -107,7 +107,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 cleanup(const struct sr_dev_driver *di) @@ -205,5 +205,5 @@ SR_PRIV struct sr_dev_driver tondaj_sl_814_driver_info = { .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/uni-t-dmm/api.c b/src/hardware/uni-t-dmm/api.c index 40ef808a..6f3ad6a2 100644 --- a/src/hardware/uni-t-dmm/api.c +++ b/src/hardware/uni-t-dmm/api.c @@ -66,7 +66,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) struct sr_config *src; const char *conn; - drvc = di->priv; + drvc = di->context; dmm = (struct dmm_info *)di; conn = NULL; @@ -109,7 +109,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) @@ -120,7 +120,7 @@ static int dev_open(struct sr_dev_inst *sdi) int ret; di = sdi->driver; - drvc = di->priv; + drvc = di->context; usb = sdi->conn; if ((ret = sr_usb_open(drvc->sr_ctx->libusb_ctx, usb)) == SR_OK) @@ -244,7 +244,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) .dev_close = dev_close, \ .dev_acquisition_start = dev_acquisition_start, \ .dev_acquisition_stop = dev_acquisition_stop, \ - .priv = NULL, \ + .context = NULL, \ }, \ VENDOR, MODEL, BAUDRATE, PACKETSIZE, \ VALID, PARSE, DETAILS, sizeof(struct CHIPSET##_info) \ diff --git a/src/hardware/uni-t-ut32x/api.c b/src/hardware/uni-t-ut32x/api.c index 136182e2..c2872666 100644 --- a/src/hardware/uni-t-ut32x/api.c +++ b/src/hardware/uni-t-ut32x/api.c @@ -53,7 +53,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) unsigned int i; const char *conn; - drvc = di->priv; + drvc = di->context; drvc->instances = NULL; conn = NULL; @@ -99,7 +99,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) @@ -109,7 +109,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; } @@ -152,7 +152,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; } @@ -175,7 +175,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; @@ -222,7 +222,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; } @@ -283,7 +283,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; - drvc = di->priv; + drvc = di->context; devc = sdi->priv; usb = sdi->conn; @@ -365,5 +365,5 @@ SR_PRIV struct sr_dev_driver uni_t_ut32x_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/uni-t-ut32x/protocol.c b/src/hardware/uni-t-ut32x/protocol.c index a79d07ae..0c7829f8 100644 --- a/src/hardware/uni-t-ut32x/protocol.c +++ b/src/hardware/uni-t-ut32x/protocol.c @@ -207,7 +207,7 @@ SR_PRIV int uni_t_ut32x_handle_events(int fd, int revents, void *cb_data) return TRUE; di = sdi->driver; - drvc = di->priv; + drvc = di->context; if (!(devc = sdi->priv)) return TRUE; diff --git a/src/hardware/victor-dmm/api.c b/src/hardware/victor-dmm/api.c index 7ed2bf43..e8230261 100644 --- a/src/hardware/victor-dmm/api.c +++ b/src/hardware/victor-dmm/api.c @@ -67,7 +67,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) (void)options; - drvc = di->priv; + drvc = di->context; devices = NULL; libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist); @@ -107,19 +107,19 @@ 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) { 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; } @@ -168,7 +168,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; } @@ -192,7 +192,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; @@ -237,7 +237,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; } @@ -343,7 +343,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; @@ -371,7 +371,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) { struct sr_dev_driver *di = sdi->driver; struct dev_context *devc; - struct drv_context *drvc = di->priv; + struct drv_context *drvc = di->context; struct sr_usb_dev_inst *usb; struct libusb_transfer *transfer; int ret; @@ -380,7 +380,7 @@ 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; } @@ -419,7 +419,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; } @@ -450,5 +450,5 @@ SR_PRIV struct sr_dev_driver victor_dmm_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/yokogawa-dlm/api.c b/src/hardware/yokogawa-dlm/api.c index 618c3a4e..382762b6 100644 --- a/src/hardware/yokogawa-dlm/api.c +++ b/src/hardware/yokogawa-dlm/api.c @@ -127,12 +127,12 @@ fail: static GSList *scan(struct sr_dev_driver *di, GSList *options) { - return sr_scpi_scan(di->priv, options, probe_usbtmc_device); + return sr_scpi_scan(di->context, options, probe_usbtmc_device); } 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 void clear_helper(void *priv) @@ -718,5 +718,5 @@ SR_PRIV struct sr_dev_driver yokogawa_dlm_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hardware/zeroplus-logic-cube/api.c b/src/hardware/zeroplus-logic-cube/api.c index 5de6f317..62577a14 100644 --- a/src/hardware/zeroplus-logic-cube/api.c +++ b/src/hardware/zeroplus-logic-cube/api.c @@ -174,7 +174,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) (void)options; - drvc = di->priv; + drvc = di->context; devices = NULL; @@ -262,7 +262,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) @@ -275,7 +275,7 @@ static int dev_open(struct sr_dev_inst *sdi) int device_count, ret, i; char connection_id[64]; - drvc = di->priv; + drvc = di->context; usb = sdi->conn; if (!(devc = sdi->priv)) { @@ -740,5 +740,5 @@ SR_PRIV struct sr_dev_driver zeroplus_logic_cube_driver_info = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = dev_acquisition_stop, - .priv = NULL, + .context = NULL, }; diff --git a/src/hwdriver.c b/src/hwdriver.c index 26ecbe1a..74d75e6a 100644 --- a/src/hwdriver.c +++ b/src/hwdriver.c @@ -397,7 +397,7 @@ SR_API GSList *sr_driver_scan(struct sr_dev_driver *driver, GSList *options) return NULL; } - if (!driver->priv) { + if (!driver->context) { sr_err("Driver not initialized, can't scan for devices."); return NULL; } @@ -434,7 +434,7 @@ SR_PRIV void sr_hw_cleanup_all(const struct sr_context *ctx) for (i = 0; drivers[i]; i++) { if (drivers[i]->cleanup) drivers[i]->cleanup(drivers[i]); - drivers[i]->priv = NULL; + drivers[i]->context = NULL; } } diff --git a/src/session_driver.c b/src/session_driver.c index ae1b2118..91c05404 100644 --- a/src/session_driver.c +++ b/src/session_driver.c @@ -171,7 +171,7 @@ static int dev_clear(const struct sr_dev_driver *di) struct drv_context *drvc; GSList *l; - drvc = di->priv; + drvc = di->context; for (l = drvc->instances; l; l = l->next) sr_dev_inst_free(l->data); g_slist_free(drvc->instances); @@ -187,7 +187,7 @@ static int dev_open(struct sr_dev_inst *sdi) struct session_vdev *vdev; di = sdi->driver; - drvc = di->priv; + drvc = di->context; vdev = g_malloc0(sizeof(struct session_vdev)); sdi->priv = vdev; drvc->instances = g_slist_append(drvc->instances, sdi); @@ -335,5 +335,5 @@ SR_PRIV struct sr_dev_driver session_driver = { .dev_close = dev_close, .dev_acquisition_start = dev_acquisition_start, .dev_acquisition_stop = NULL, - .priv = NULL, + .context = NULL, }; diff --git a/src/std.c b/src/std.c index 008e645c..5b97f66a 100644 --- a/src/std.c +++ b/src/std.c @@ -56,7 +56,7 @@ SR_PRIV int std_init(struct sr_context *sr_ctx, struct sr_dev_driver *di, drvc = g_malloc0(sizeof(struct drv_context)); drvc->sr_ctx = sr_ctx; drvc->instances = NULL; - di->priv = drvc; + di->context = drvc; return SR_OK; } @@ -247,7 +247,7 @@ SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver, GSList *l; int ret; - if (!(drvc = driver->priv)) + if (!(drvc = driver->context)) /* Driver was never initialized, nothing to do. */ return SR_OK;