]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/beaglelogic/api.c
sr_dev_close(): Factor out SR_ERR_DEV_CLOSED check.
[libsigrok.git] / src / hardware / beaglelogic / api.c
index 09fcf0bdb5577459d49b2f7602b8ba03aaa0ff51..0d022f2b336967e0aea956071d21ca92589c55eb 100644 (file)
@@ -166,12 +166,12 @@ static int dev_close(struct sr_dev_inst *sdi)
 {
        struct dev_context *devc = sdi->priv;
 
-       if (sdi->status == SR_ST_ACTIVE) {
-               /* Close the memory mapping and the file */
-               beaglelogic_munmap(devc);
-               beaglelogic_close(devc);
-       }
+       /* Close the memory mapping and the file */
+       beaglelogic_munmap(devc);
+       beaglelogic_close(devc);
+
        sdi->status = SR_ST_INACTIVE;
+
        return SR_OK;
 }