def METHOD_NAME(self):
    if not self.devname:
        return
    _, _, opencount = self.dminfo()
    print(f"closing (opencount: {opencount})")
    self.lock.release()
    self.lock = None
    name = self.devname
    self.devname = None
    # finally close the device
    subprocess.run(["cryptsetup", "-q", "close", name],
                   check=self.check,
                   stdout=subprocess.PIPE,
                   stderr=subprocess.STDOUT,
                   encoding="UTF-8")