]> sigrok.org Git - libsigrok.git/blobdiff - hardware/tondaj-sl-814/api.c
tondaj-sl-814: remove unneeded debugging
[libsigrok.git] / hardware / tondaj-sl-814 / api.c
index c1d8abf8bc2206600ce10a197446470b092253ca..5c72c6a29221a8424f6a5f5814c62bf440cb3360 100644 (file)
@@ -73,7 +73,7 @@ static int clear_instances(void)
        return SR_OK;
 }
 
-static int hw_init(void)
+static int hw_init(struct sr_context *sr_ctx)
 {
        struct drv_context *drvc;
 
@@ -82,6 +82,7 @@ static int hw_init(void)
                return SR_ERR_MALLOC;
        }
 
+       drvc->sr_ctx = sr_ctx;
        di->priv = drvc;
 
        return SR_OK;
@@ -119,10 +120,8 @@ static GSList *hw_scan(GSList *options)
                        break;
                }
        }
-       if (!conn) {
-               sr_dbg("Couldn't determine connection options.");
+       if (!conn)
                return NULL;
-       }
        if (!serialcomm)
                serialcomm = SERIALCOMM;
 
@@ -140,7 +139,7 @@ static GSList *hw_scan(GSList *options)
        if (!(devc->serial = sr_serial_dev_inst_new(conn, serialcomm)))
                return NULL;
 
-       if (serial_open(devc->serial, O_RDWR|O_NONBLOCK) != SR_OK)
+       if (serial_open(devc->serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
                return NULL;
 
        sdi->priv = devc;
@@ -172,7 +171,7 @@ static int hw_dev_open(struct sr_dev_inst *sdi)
 
        devc = sdi->priv;
 
-       if (serial_open(devc->serial, O_RDWR|O_NONBLOCK) != SR_OK)
+       if (serial_open(devc->serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
                return SR_ERR;
 
        sdi->status = SR_ST_ACTIVE;