]> sigrok.org Git - libsigrok.git/commitdiff
serial-dmm: Remove global sr_dev_driver *di alias
authorAlexandru Gagniuc <redacted>
Thu, 13 Dec 2012 16:53:28 +0000 (10:53 -0600)
committerUwe Hermann <redacted>
Thu, 13 Dec 2012 22:16:34 +0000 (23:16 +0100)
The global *di alias was used to keep track of the driver context.
It caused issues with trying to use several subdrivers at once, so
its use was obsoleted.

The correct context is preserved through different mechanisms, either
the *sdi pointer, or wrappers which pass the correct context.

The *di alias is no longer used, so remove it.

Signed-off-by: Alexandru Gagniuc <redacted>
hardware/serial-dmm/api.c

index 79bcbb614c7ebd0e4552b882f5a41dc3129295dc..6e9eaa2478cc4f19d5f7c014b2611fd263c3dd41 100644 (file)
@@ -59,9 +59,6 @@ SR_PRIV struct sr_dev_driver pce_pce_dm32_driver_info;
 SR_PRIV struct sr_dev_driver radioshack_22_168_driver_info;
 SR_PRIV struct sr_dev_driver radioshack_22_812_driver_info;
 
-/* After hw_init() this will point to a device-specific entry (see above). */
-static struct sr_dev_driver *di = NULL;
-
 SR_PRIV struct dmm_info dmms[] = {
        {
                "Digitek", "DT4000ZC", "2400/8n1", 2400,
@@ -180,11 +177,9 @@ static int hw_init(struct sr_context *sr_ctx, int dmm)
                return SR_ERR_MALLOC;
        }
 
-       di = dmms[dmm].di;
        sr_dbg("Selected '%s' subdriver.", dmms[dmm].di->name);
 
        drvc->sr_ctx = sr_ctx;
-       //// di->priv = drvc;
        dmms[dmm].di->priv = drvc;
 
        return SR_OK;
@@ -210,7 +205,6 @@ static GSList *scan(const char *conn, const char *serialcomm, int dmm)
 
        sr_info("Probing port %s.", conn);
 
-       //// drvc = di->priv;
        drvc = dmms[dmm].di->priv;
        devices = NULL;
        serial_flush(serial);