]> sigrok.org Git - libsigrok.git/blobdiff - hardware/lascar-el-usb/protocol.c
Add struct sr_session parameter to all session source backends.
[libsigrok.git] / hardware / lascar-el-usb / protocol.c
index eeb22199f36fdfe2dd74e17afed64fa6b5548d2c..49c5cd0a3687e3416c8585edd72c1634cca7e204 100644 (file)
@@ -330,18 +330,18 @@ static struct sr_dev_inst *lascar_identify(unsigned char *config)
 
                if (profile->logformat == LOG_TEMP_RH) {
                        /* Model this as two channels: temperature and humidity. */
-                       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "Temp")))
+                       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "Temp")))
                                return NULL;
                        sdi->channels = g_slist_append(NULL, ch);
-                       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "Hum")))
+                       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "Hum")))
                                return NULL;
                        sdi->channels = g_slist_append(sdi->channels, ch);
                } else if (profile->logformat == LOG_CO) {
-                       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "CO")))
+                       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "CO")))
                                return NULL;
                        sdi->channels = g_slist_append(NULL, ch);
                } else {
-                       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+                       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1")))
                                return NULL;
                        sdi->channels = g_slist_append(NULL, ch);
                }
@@ -499,7 +499,7 @@ SR_PRIV int lascar_el_usb_handle_events(int fd, int revents, void *cb_data)
        sdi = cb_data;
 
        if (sdi->status == SR_ST_STOPPING) {
-               usb_source_remove(drvc->sr_ctx);
+               usb_source_remove(sdi->session, drvc->sr_ctx);
 
                packet.type = SR_DF_END;
                sr_session_send(cb_data, &packet);