Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337011
b: refs/heads/master
c: 87c4d1a
h: refs/heads/master
i:
  337009: da830ab
  337007: 705b796
v: v3
  • Loading branch information
Damian Hobson-Garcia authored and Greg Kroah-Hartman committed Nov 21, 2012
1 parent b09f1cb commit 583c6f7
Show file tree
Hide file tree
Showing 3 changed files with 6 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: 24fce61b0b7f1bc94970036db1f1d65b0770d168
refs/heads/master: 87c4d1a7dce956b86e34329ed1b11a751ba9a8ea
2 changes: 1 addition & 1 deletion trunk/Documentation/DocBook/uio-howto.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ framework to set up sysfs files for this region. Simply leave it alone.
<varname>/sys/class/uio/uioX/maps/mapY/*</varname>.
The dynmaic memory regions will be freed when the UIO device file is
closed. When no processes are holding the device file open, the address
returned to userspace is DMA_ERROR_CODE.
returned to userspace is ~0.
</para>
</sect1>

Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/uio/uio_dmem_genirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <linux/of_address.h>

#define DRIVER_NAME "uio_dmem_genirq"
#define DMEM_MAP_ERROR (~0)

struct uio_dmem_genirq_platdata {
struct uio_info *uioinfo;
Expand Down Expand Up @@ -60,6 +61,7 @@ static int uio_dmem_genirq_open(struct uio_info *info, struct inode *inode)
addr = dma_alloc_coherent(&priv->pdev->dev, uiomem->size,
(dma_addr_t *)&uiomem->addr, GFP_KERNEL);
if (!addr) {
uiomem->addr = DMEM_MAP_ERROR;
ret = -ENOMEM;
break;
}
Expand Down Expand Up @@ -95,7 +97,7 @@ static int uio_dmem_genirq_release(struct uio_info *info, struct inode *inode)
dma_free_coherent(&priv->pdev->dev, uiomem->size,
priv->dmem_region_vaddr[dmem_region++],
uiomem->addr);
uiomem->addr = DMA_ERROR_CODE;
uiomem->addr = DMEM_MAP_ERROR;
++uiomem;
}

Expand Down Expand Up @@ -238,7 +240,7 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev)
break;
}
uiomem->memtype = UIO_MEM_PHYS;
uiomem->addr = DMA_ERROR_CODE;
uiomem->addr = DMEM_MAP_ERROR;
uiomem->size = pdata->dynamic_region_sizes[i];
++uiomem;
}
Expand Down

0 comments on commit 583c6f7

Please sign in to comment.