mbochs_dmabuf_find_by_mode(struct mdev_state *mdev_state,
			   struct mbochs_mode *mode)
{
	struct mbochs_dmabuf *dmabuf;

	WARN_ON(!mutex_is_locked(&mdev_state->ops_lock));

	list_for_each_entry(dmabuf, &mdev_state->dmabufs, next)
		if (mbochs_modes_equal(&dmabuf->mode, mode))
			return dmabuf;

	return NULL;
}
mbochs_dmabuf_find_by_mode(struct mdev_state *mdev_state,
			   struct mbochs_mode *mode)
{
	struct mbochs_dmabuf *dmabuf;

	WARN_ON(!mutex_is_locked(&mdev_state->ops_lock));

	list_for_each_entry(dmabuf, &mdev_state->dmabufs, next)
		if (mbochs_modes_equal(&dmabuf->mode, mode))
			return dmabuf;

	return NULL;
}