/* alloc memory for the gather ring no need to alloc buf for the ring gdr_tail, gdr_head and gdr_count are initialized by this function  */
static u32 crypto4xx_build_gdr(struct crypto4xx_device *dev)
/* alloc memory for the gather ring no need to alloc buf for the ring gdr_tail, gdr_head and gdr_count are initialized by this function  */
static u32 crypto4xx_build_gdr(struct crypto4xx_device *dev)
{
	dev->gdr = dma_alloc_coherent(dev->core_dev->device,
				      sizeof(struct ce_gd) * PPC4XX_NUM_GD,
				      &dev->gdr_pa, GFP_ATOMIC);
	if (!dev->gdr)
		return -ENOMEM;
	memset(dev->gdr, 0, sizeof(struct ce_gd) * PPC4XX_NUM_GD);
	return 0;
}