/* Returns the memory region on success, otherwise returns an errno. Note that all DMA addresses should be created via the struct ib_dma_mapping_ops functions (see ipath_dma.c).  */
struct ib_mr* ipath_get_dma_mr(struct ib_pd *pd, int acc)
/* Returns the memory region on success, otherwise returns an errno. Note that all DMA addresses should be created via the struct ib_dma_mapping_ops functions (see ipath_dma.c).  */
struct ib_mr* ipath_get_dma_mr(struct ib_pd *pd, int acc)
{
	struct ipath_mr *mr;
	struct ib_mr *ret;
	mr = kzalloc(sizeof *mr, GFP_KERNEL);
	if (!mr) {
		ret = ERR_PTR(-ENOMEM);
		goto bail;
	}
	mr->mr.access_flags = acc;
	ret = &mr->ibmr;
bail:
	return ret;
}