static char *crypt_get_device_key_description(struct crypt_device *cd, const char *name)
{
	char *desc = NULL;
	struct crypt_dm_active_device dmd;
	struct dm_target *tgt = &dmd.segment;

	if (dm_query_device(cd, name, DM_ACTIVE_CRYPT_KEY | DM_ACTIVE_CRYPT_KEYSIZE, &dmd) < 0)
		return NULL;

	if (single_segment(&dmd) && tgt->type == DM_CRYPT &&
	    (dmd.flags & CRYPT_ACTIVATE_KEYRING_KEY) && tgt->u.crypt.vk->key_description)
		desc = strdup(tgt->u.crypt.vk->key_description);

	dm_targets_free(cd, &dmd);

	return desc;
}
static char *crypt_get_device_key_description(struct crypt_device *cd, const char *name)
{
	char *desc = NULL;
	struct crypt_dm_active_device dmd;
	struct dm_target *tgt = &dmd.segment;

	if (dm_query_device(cd, name, DM_ACTIVE_CRYPT_KEY | DM_ACTIVE_CRYPT_KEYSIZE, &dmd) < 0)
		return NULL;

	if (single_segment(&dmd) && tgt->type == DM_CRYPT &&
	    (dmd.flags & CRYPT_ACTIVATE_KEYRING_KEY) && tgt->u.crypt.vk->key_description)
		desc = strdup(tgt->u.crypt.vk->key_description);

	dm_targets_free(cd, &dmd);

	return desc;
}