]> sigrok.org Git - libsigrok.git/commitdiff
hw_init(): Save struct sr_context * parameter in struct drv_context
authorPeter Stuge <redacted>
Mon, 3 Dec 2012 01:49:36 +0000 (02:49 +0100)
committerBert Vermeulen <redacted>
Mon, 3 Dec 2012 11:07:40 +0000 (12:07 +0100)
15 files changed:
hardware/agilent-dmm/api.c
hardware/asix-sigma/asix-sigma.c
hardware/chronovu-la8/api.c
hardware/colead-slm/api.c
hardware/demo/demo.c
hardware/fluke-dmm/api.c
hardware/fx2lafw/fx2lafw.c
hardware/hantek-dso/api.c
hardware/openbench-logic-sniffer/ols.c
hardware/serial-dmm/api.c
hardware/tondaj-sl-814/api.c
hardware/uni-t-dmm/api.c
hardware/victor-dmm/api.c
hardware/zeroplus-logic-cube/zeroplus.c
libsigrok-internal.h

index b68c9e7fbe2e55a6a42f05fc02f042f102e4cb11..de89422a7a4d9a4af0759037f2c120b72194cf57 100644 (file)
@@ -103,6 +103,7 @@ static int hw_init(struct sr_context *sr_ctx)
                return SR_ERR_MALLOC;
        }
 
+       drvc->sr_ctx = sr_ctx;
        di->priv = drvc;
 
        return SR_OK;
index 6d9bea2d7b656d01f23b75068cb8752bc2983e2a..ed263acb43b47256aaab3c7a7f799cdf85dbc8ff 100644 (file)
@@ -440,6 +440,7 @@ static int hw_init(struct sr_context *sr_ctx)
                sr_err("Driver context malloc failed.");
                return SR_ERR_MALLOC;
        }
+       drvc->sr_ctx = sr_ctx;
        adi->priv = drvc;
 
        return SR_OK;
index b3c37910c0e81adb0d1858a02ecc00ebbbb5b456..9a512f90c786fbd930e4e0c89860a69b6cccf8e6 100644 (file)
@@ -77,6 +77,7 @@ static int hw_init(struct sr_context *sr_ctx)
                return SR_ERR_MALLOC;
        }
 
+       drvc->sr_ctx = sr_ctx;
        di->priv = drvc;
 
        return SR_OK;
index f7d596dc4fb0f059794922647c51f7cf9cd79e5c..c4346ba6fe9fb9778523cb16dec692ebb98f81d0 100644 (file)
@@ -86,6 +86,7 @@ static int hw_init(struct sr_context *sr_ctx)
                return SR_ERR;
        }
 
+       drvc->sr_ctx = sr_ctx;
        di->priv = drvc;
 
        return SR_OK;
index ff7ba06b7ce39ea3d1f7274f9690a260cf2345cf..68fda728571126bd5b59892fe007fb8bdbcc27f7 100644 (file)
@@ -161,6 +161,7 @@ static int hw_init(struct sr_context *sr_ctx)
                sr_err("Driver context malloc failed.");
                return SR_ERR_MALLOC;
        }
+       drvc->sr_ctx = sr_ctx;
        ddi->priv = drvc;
 
        return SR_OK;
index 2687c12eaa5f663b2d649355b4e0a4ce4099b76f..154479ccc25c039c67154bf7883f31562b7c023a 100644 (file)
@@ -90,6 +90,7 @@ static int hw_init(struct sr_context *sr_ctx)
                return SR_ERR_MALLOC;
        }
 
+       drvc->sr_ctx = sr_ctx;
        di->priv = drvc;
 
        return SR_OK;
index c82cef8742d95fd5bf4ff1e16bb305dbc2730d50..c19400414beef8a1c219cf188c26289af9e23937 100644 (file)
@@ -414,6 +414,7 @@ static int hw_init(struct sr_context *sr_ctx)
                return SR_ERR;
        }
 
+       drvc->sr_ctx = sr_ctx;
        fdi->priv = drvc;
 
        return SR_OK;
index e221b5f20a871d49c0e20ae6c789ff13ac344f89..08c1164293c2f299949e2c3c51dd12cd30122604 100644 (file)
@@ -268,6 +268,7 @@ static int hw_init(struct sr_context *sr_ctx)
                return SR_ERR;
        }
 
+       drvc->sr_ctx = sr_ctx;
        hdi->priv = drvc;
 
        return SR_OK;
index 4d369bace57cf1bd962e7dfa22198ea4dd8956a1..23104cfddc3d8aa455984a19043d573099ded007 100644 (file)
@@ -370,6 +370,7 @@ static int hw_init(struct sr_context *sr_ctx)
                sr_err("ols: driver context malloc failed.");
                return SR_ERR_MALLOC;
        }
+       drvc->sr_ctx = sr_ctx;
        odi->priv = drvc;
 
        return SR_OK;
index a146ec86f460bd09384cbcf0867b32d7dec1767c..8a2d7be2afac42b80fccd924d88801c2d3c56cd9 100644 (file)
@@ -202,6 +202,7 @@ static int hw_init(struct sr_context *sr_ctx, int dmm)
                di = di_22_812;
        sr_dbg("Selected '%s' subdriver.", di->name);
 
+       drvc->sr_ctx = sr_ctx;
        di->priv = drvc;
 
        return SR_OK;
index 8962437069de2147ee8b55816148faa1802ac058..17fbc2b1b4d91bfac21e93b866f3be132ecf8716 100644 (file)
@@ -82,6 +82,7 @@ static int hw_init(struct sr_context *sr_ctx)
                return SR_ERR_MALLOC;
        }
 
+       drvc->sr_ctx = sr_ctx;
        di->priv = drvc;
 
        return SR_OK;
index e96cf00aa399b3cf0767a25d945a524fdcdceb5e..8e390c06882cb254a751e6a6452ecb49cf8a60ba 100644 (file)
@@ -75,6 +75,7 @@ static int hw_init(struct sr_context *sr_ctx, int dmm)
                di = di_vc820;
        sr_dbg("Selected '%s' subdriver.", di->name);
 
+       drvc->sr_ctx = sr_ctx;
        di->priv = drvc;
 
        return SR_OK;
index b5a28a6e28d93b5e1fa91a7531d62d3629403870..07c61faf3056f2a149dfe6dd1c85de0a808700a9 100644 (file)
@@ -84,6 +84,7 @@ static int hw_init(struct sr_context *sr_ctx)
                sr_err("Driver context malloc failed.");
                return SR_ERR_MALLOC;
        }
+       drvc->sr_ctx = sr_ctx;
        di->priv = drvc;
 
        return SR_OK;
index 57345da8769ff0c4a8ae8d388e3fed3ad5774eae..a67e46006fd769c8fc2bcd126d3c6c6de987fdf9 100644 (file)
@@ -311,6 +311,7 @@ static int hw_init(struct sr_context *sr_ctx)
                sr_err("zeroplus: driver context malloc failed.");
                return SR_ERR_MALLOC;
        }
+       drvc->sr_ctx = sr_ctx;
        zdi->priv = drvc;
 
        if (libusb_init(&usb_context) != 0) {
index 4b3ae68d23758d15d776d03ff428cf2965b144b6..ddb4f995e8c4787b4d7a71ca4c860082af444cc9 100644 (file)
@@ -76,6 +76,7 @@ struct sr_serial_dev_inst {
 
 /* Private driver context. */
 struct drv_context {
+       struct sr_context *sr_ctx;
        GSList *instances;
 };