Skip to content

Commit

Permalink
iop-adma.c: use resource_size()
Browse files Browse the repository at this point in the history
The size of the requested and ioremaped memory is off by 1.
Use resource_size() to get the correct value.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
H Hartley Sweeten authored and Dan Williams committed Dec 12, 2009
1 parent a88f666 commit 2e032b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/dma/iop-adma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,7 @@ static int __devinit iop_adma_probe(struct platform_device *pdev)
return -ENODEV;

if (!devm_request_mem_region(&pdev->dev, res->start,
res->end - res->start, pdev->name))
resource_size(res), pdev->name))
return -EBUSY;

adev = kzalloc(sizeof(*adev), GFP_KERNEL);
Expand Down Expand Up @@ -1542,7 +1542,7 @@ static int __devinit iop_adma_probe(struct platform_device *pdev)
iop_chan->device = adev;

iop_chan->mmr_base = devm_ioremap(&pdev->dev, res->start,
res->end - res->start);
resource_size(res));
if (!iop_chan->mmr_base) {
ret = -ENOMEM;
goto err_free_iop_chan;
Expand Down

0 comments on commit 2e032b6

Please sign in to comment.