From: Daniel Elstner Date: Tue, 10 Nov 2015 19:52:09 +0000 (+0100) Subject: sysclk-lwla: Remove global driver instance pointer X-Git-Tag: libsigrok-0.4.0~111 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ce19d4c6157b2998aa88a2f32670dd7bdcca02e8;p=libsigrok.git sysclk-lwla: Remove global driver instance pointer Obtain the sr_dev_driver pointer from the device instance so that the remaining references to the global di pointer can be removed. --- diff --git a/src/hardware/sysclk-lwla/api.c b/src/hardware/sysclk-lwla/api.c index 154d4f90..1b9f1bce 100644 --- a/src/hardware/sysclk-lwla/api.c +++ b/src/hardware/sysclk-lwla/api.c @@ -72,9 +72,6 @@ static const char *const trigger_source_names[] = { "CH", "TRG" }; */ static const char *const signal_edge_names[] = { "r", "f" }; -SR_PRIV struct sr_dev_driver sysclk_lwla_driver_info; -static struct sr_dev_driver *const di = &sysclk_lwla_driver_info; - static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx) { return std_init(sr_ctx, di, LOG_PREFIX); @@ -187,7 +184,7 @@ static int dev_open(struct sr_dev_inst *sdi) struct sr_usb_dev_inst *usb; int ret; - drvc = di->context; + drvc = sdi->driver->context; if (!drvc) { sr_err("Driver was not initialized."); @@ -238,7 +235,7 @@ static int dev_close(struct sr_dev_inst *sdi) struct dev_context *devc; int ret; - if (!di->context) { + if (!sdi->driver->context) { sr_err("Driver was not initialized."); return SR_ERR; } @@ -576,7 +573,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->context; + drvc = sdi->driver->context; if (devc->acquisition) { sr_err("Acquisition still in progress?");