]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/victor-dmm/api.c
Remove unnecessary driver context checks
[libsigrok.git] / src / hardware / victor-dmm / api.c
index 9323e70015770c902d9b29c89d3a385edace2a67..8f20f599fca7ead98f9cffe0ce06b11d45ba930c 100644 (file)
@@ -110,11 +110,6 @@ static int dev_open(struct sr_dev_inst *sdi)
        int ret, i;
        char connection_id[64];
 
-       if (!di->context) {
-               sr_err("Driver was not initialized.");
-               return SR_ERR;
-       }
-
        usb = sdi->conn;
 
        libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist);
@@ -156,14 +151,8 @@ static int dev_open(struct sr_dev_inst *sdi)
 
 static int dev_close(struct sr_dev_inst *sdi)
 {
-       struct sr_dev_driver *di = sdi->driver;
        struct sr_usb_dev_inst *usb;
 
-       if (!di->context) {
-               sr_err("Driver was not initialized.");
-               return SR_ERR;
-       }
-
        usb = sdi->conn;
 
        if (!usb->devhdl)
@@ -204,7 +193,6 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
 static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg)
 {
-       struct sr_dev_driver *di = sdi->driver;
        struct dev_context *devc;
        gint64 now;
 
@@ -213,11 +201,6 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       if (!di->context) {
-               sr_err("Driver was not initialized.");
-               return SR_ERR;
-       }
-
        devc = sdi->priv;
 
        switch (key) {
@@ -351,11 +334,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       if (!di->context) {
-               sr_err("Driver was not initialized.");
-               return SR_ERR;
-       }
-
        usb = sdi->conn;
 
        std_session_send_df_header(sdi, LOG_PREFIX);
@@ -384,13 +362,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
 static int dev_acquisition_stop(struct sr_dev_inst *sdi)
 {
-       struct sr_dev_driver *di = sdi->driver;
-
-       if (!di->context) {
-               sr_err("Driver was not initialized.");
-               return SR_ERR;
-       }
-
        if (sdi->status != SR_ST_ACTIVE) {
                sr_err("Device not active, can't stop acquisition.");
                return SR_ERR;