]> sigrok.org Git - libsigrok.git/commitdiff
ols: change driver dev_acquisition_start/_stop calls to use sdi
authorBert Vermeulen <redacted>
Sun, 22 Jul 2012 10:35:57 +0000 (12:35 +0200)
committerBert Vermeulen <redacted>
Fri, 3 Aug 2012 09:27:31 +0000 (11:27 +0200)
...yeah, forgot OLS.

hardware/openbench-logic-sniffer/ols.c

index 735f5fda14d784d48d1f4b2a8f52ce78f5f935b2..ad5e7f29ed86f9220202d471b5e7a0cfb509d97a 100644 (file)
@@ -884,12 +884,12 @@ static int receive_data(int fd, int revents, void *cb_data)
        return TRUE;
 }
 
-static int hw_dev_acquisition_start(int dev_index, void *cb_data)
+static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
+               void *cb_data)
 {
        struct sr_datafeed_packet *packet;
        struct sr_datafeed_header *header;
        struct sr_datafeed_meta_logic meta;
-       struct sr_dev_inst *sdi;
        struct context *ctx;
        uint32_t trigger_config[4];
        uint32_t data;
@@ -898,9 +898,6 @@ static int hw_dev_acquisition_start(int dev_index, void *cb_data)
        int num_channels;
        int i;
 
-       if (!(sdi = sr_dev_inst_get(odi->instances, dev_index)))
-               return SR_ERR;
-
        ctx = sdi->priv;
 
        if (sdi->status != SR_ST_ACTIVE)
@@ -1044,12 +1041,13 @@ static int hw_dev_acquisition_start(int dev_index, void *cb_data)
 }
 
 /* TODO: This stops acquisition on ALL devices, ignoring dev_index. */
-static int hw_dev_acquisition_stop(int dev_index, void *cb_data)
+static int hw_dev_acquisition_stop(const struct sr_dev_inst *sdi,
+               void *cb_data)
 {
        struct sr_datafeed_packet packet;
 
        /* Avoid compiler warnings. */
-       (void)dev_index;
+       (void)sdi;
 
        packet.type = SR_DF_END;
        sr_session_send(cb_data, &packet);