]> sigrok.org Git - libsigrok.git/commitdiff
Don't automatically clear known instances from USB drivers on scan
authorBert Vermeulen <redacted>
Sat, 27 Apr 2013 16:27:32 +0000 (18:27 +0200)
committerBert Vermeulen <redacted>
Sat, 27 Apr 2013 16:27:32 +0000 (18:27 +0200)
This invalidates previously returned sr_dev_inst pointers, which a
frontend may be holding. It's the frontend's responsibility to clear
the list of instances a driver keeps track of by calling

sr_dev_clear(driver);

if it wants a completely new scan done.

hardware/asix-sigma/asix-sigma.c
hardware/fx2lafw/fx2lafw.c
hardware/hantek-dso/api.c
hardware/lascar-el-usb/api.c
hardware/nexus-osciprime/api.c
hardware/uni-t-dmm/api.c
hardware/victor-dmm/api.c
hardware/zeroplus-logic-cube/api.c

index cfd95a1115e924ba431d61f275e24ec6118ba0e2..125f9cd9f47383c3f1cad249af51f01546f0e67e 100644 (file)
@@ -431,8 +431,6 @@ static GSList *hw_scan(GSList *options)
 
        devices = NULL;
 
-       clear_instances();
-
        if (!(devc = g_try_malloc(sizeof(struct dev_context)))) {
                sr_err("%s: devc malloc failed", __func__);
                return NULL;
index dbec30b754904e84244135a3bfb1a73e276501cd..9647c4b0e903cf92b439d73f1f7175fd1b1e450e 100644 (file)
@@ -371,9 +371,6 @@ static GSList *hw_scan(GSList *options)
 
        drvc = di->priv;
 
-       /* This scan always invalidates any previous scans. */
-       clear_instances();
-
        conn = NULL;
        for (l = options; l; l = l->next) {
                src = l->data;
index e7d9f60b618910febce8225181785f1d3e0507f0..e75eec615fe8cbafd7129d364f5538482e67f867 100644 (file)
@@ -269,13 +269,10 @@ static GSList *hw_scan(GSList *options)
        const char *conn;
 
        drvc = di->priv;
-       drvc->instances = NULL;
 
        devcnt = 0;
        devices = 0;
 
-       clear_instances();
-
        conn = NULL;
        for (l = options; l; l = l->next) {
                src = l->data;
index c841a132389652a1b64d47ab8871ce05e0ef9673..ea2a80f7a2e738cf5c35050228e763f0b2657dd7 100644 (file)
@@ -85,9 +85,6 @@ static GSList *hw_scan(GSList *options)
 
        drvc = di->priv;
 
-       /* USB scan is always authoritative. */
-       clear_instances();
-
        conn = NULL;
        for (l = options; l; l = l->next) {
                src = l->data;
index 238cda515867bd5ee5d278e53e4c78493acc0b0f..4f1ae2fede532dd31910fa79e40b542ab4bfa7f0 100644 (file)
@@ -157,9 +157,6 @@ static GSList *hw_scan(GSList *options)
 
        drvc = di->priv;
 
-       /* USB scan is always authoritative. */
-       clear_instances();
-
        conn = NULL;
        for (l = options; l; l = l->next) {
                src = l->data;
index cf1e4df5ed4b207d3b876ae021d571ca839bdb07..08a9e74725f4b4824987264231068443f04cf142 100644 (file)
@@ -86,9 +86,6 @@ static GSList *hw_scan(GSList *options, int dmm)
 
        drvc = udmms[dmm].di->priv;
 
-       /* USB scan is always authoritative. */
-       clear_instances(dmm);
-
        conn = NULL;
        for (l = options; l; l = l->next) {
                src = l->data;
index c15239eddef18e4eb95ae8780edd14a54978d4f6..aa33e1f1420168d882232b9591fc8a87169c407d 100644 (file)
@@ -95,9 +95,6 @@ static GSList *hw_scan(GSList *options)
 
        drvc = di->priv;
 
-       /* USB scan is always authoritative. */
-       clear_instances();
-
        devices = NULL;
        libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist);
        for (i = 0; devlist[i]; i++) {
index f9578a8baceae2417f85e695215c75f312ee16aa..f6478dfc5bab045ef6ea6e144c90ef72df9e906c 100644 (file)
@@ -290,8 +290,6 @@ static GSList *hw_scan(GSList *options)
 
        devices = NULL;
 
-       clear_instances();
-
        /* Find all ZEROPLUS analyzers and add them to device list. */
        devcnt = 0;
        libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist); /* TODO: Errors. */