struct platform_device *pdev;
unsigned int dmem_region_start;
unsigned int num_dmem_regions;
+ void *dmem_region_vaddr[MAX_UIO_MAPS];
struct mutex alloc_lock;
unsigned int refcnt;
};
struct uio_dmem_genirq_platdata *priv = info->priv;
struct uio_mem *uiomem;
int ret = 0;
+ int dmem_region = priv->dmem_region_start;
uiomem = &priv->uioinfo->mem[priv->dmem_region_start];
ret = -ENOMEM;
break;
}
-
- uiomem->internal_addr = addr;
+ priv->dmem_region_vaddr[dmem_region++] = addr;
++uiomem;
}
priv->refcnt++;
{
struct uio_dmem_genirq_platdata *priv = info->priv;
struct uio_mem *uiomem;
+ int dmem_region = priv->dmem_region_start;
/* Tell the Runtime PM code that the device has become idle */
pm_runtime_put_sync(&priv->pdev->dev);
break;
dma_free_coherent(&priv->pdev->dev, uiomem->size,
- uiomem->internal_addr, uiomem->addr);
+ priv->dmem_region_vaddr[dmem_region++],
+ uiomem->addr);
uiomem->addr = DMA_ERROR_CODE;
++uiomem;
}