Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337010
b: refs/heads/master
c: 24fce61
h: refs/heads/master
v: v3
  • Loading branch information
Damian Hobson-Garcia authored and Greg Kroah-Hartman committed Nov 21, 2012
1 parent da830ab commit b09f1cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9b96c3124b66a959ba061dbca339944a81686cd2
refs/heads/master: 24fce61b0b7f1bc94970036db1f1d65b0770d168
9 changes: 6 additions & 3 deletions trunk/drivers/uio/uio_dmem_genirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ struct uio_dmem_genirq_platdata {
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;
};
Expand All @@ -46,6 +47,7 @@ static int uio_dmem_genirq_open(struct uio_info *info, struct inode *inode)
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];

Expand All @@ -61,8 +63,7 @@ static int uio_dmem_genirq_open(struct uio_info *info, struct inode *inode)
ret = -ENOMEM;
break;
}

uiomem->internal_addr = addr;
priv->dmem_region_vaddr[dmem_region++] = addr;
++uiomem;
}
priv->refcnt++;
Expand All @@ -77,6 +78,7 @@ static int uio_dmem_genirq_release(struct uio_info *info, struct inode *inode)
{
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);
Expand All @@ -91,7 +93,8 @@ static int uio_dmem_genirq_release(struct uio_info *info, struct inode *inode)
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;
}
Expand Down

0 comments on commit b09f1cb

Please sign in to comment.