]> sigrok.org Git - libsigrok.git/blobdiff - hardware/kecheng-kc-330b/protocol.c
Use common usb_source_add and usb_source_remove functions.
[libsigrok.git] / hardware / kecheng-kc-330b / protocol.c
index a3a09514a419663edb0b423d194d8fa76b797ccf..c6263cde3227d6c95069ff4de6c27dbf74360ba8 100644 (file)
@@ -34,7 +34,7 @@ SR_PRIV int kecheng_kc_330b_handle_events(int fd, int revents, void *cb_data)
        struct timeval tv;
        const uint64_t *intv_entry;
        gint64 now, interval;
-       int offset, len, ret, i;
+       int offset, len, ret;
        unsigned char buf[4];
 
        (void)fd;
@@ -51,8 +51,7 @@ SR_PRIV int kecheng_kc_330b_handle_events(int fd, int revents, void *cb_data)
 
        if (sdi->status == SR_ST_STOPPING) {
                libusb_free_transfer(devc->xfer);
-               for (i = 0; devc->usbfd[i] != -1; i++)
-                       sr_source_remove(devc->usbfd[i]);
+               usb_source_remove(drvc->sr_ctx);
                packet.type = SR_DF_END;
                sr_session_send(cb_data, &packet);
                sdi->status = SR_ST_ACTIVE;