]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/beaglelogic/api.c
scpi/usbtmc: Implement Rigol DS1000 workaround on any firmware version.
[libsigrok.git] / src / hardware / beaglelogic / api.c
index 5f1d35fc1716f88172024d0795d1d464461c232b..1c8e43b84f55f722142b356547b367cd926a2fe4 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include "protocol.h"
 #include "beaglelogic.h"
 
@@ -87,7 +88,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        int i, maxch;
 
        devices = NULL;
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
 
        /* Probe for /dev/beaglelogic */
@@ -146,7 +147,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_clear(const struct sr_dev_driver *di)
@@ -165,6 +166,7 @@ static int dev_open(struct sr_dev_inst *sdi)
        /* Set fd and local attributes */
        devc->pollfd.fd = devc->fd;
        devc->pollfd.events = G_IO_IN;
+       devc->pollfd.revents = 0;
 
        /* Get the default attributes */
        beaglelogic_get_samplerate(devc);
@@ -205,7 +207,7 @@ static int cleanup(const struct sr_dev_driver *di)
        GSList *l;
 
        /* unused driver */
-       if (!(drvc = di->priv))
+       if (!(drvc = di->context))
                return SR_OK;
 
        /* Clean up the instances */
@@ -422,5 +424,5 @@ SR_PRIV struct sr_dev_driver beaglelogic_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };