forked from Minki/linux
iop-adma.c: use resource_size()
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>
This commit is contained in:
parent
a88f666707
commit
2e032b62c4
@ -1470,7 +1470,7 @@ static int __devinit iop_adma_probe(struct platform_device *pdev)
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
if (!devm_request_mem_region(&pdev->dev, res->start,
|
if (!devm_request_mem_region(&pdev->dev, res->start,
|
||||||
res->end - res->start, pdev->name))
|
resource_size(res), pdev->name))
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
adev = kzalloc(sizeof(*adev), GFP_KERNEL);
|
adev = kzalloc(sizeof(*adev), GFP_KERNEL);
|
||||||
@ -1542,7 +1542,7 @@ static int __devinit iop_adma_probe(struct platform_device *pdev)
|
|||||||
iop_chan->device = adev;
|
iop_chan->device = adev;
|
||||||
|
|
||||||
iop_chan->mmr_base = devm_ioremap(&pdev->dev, res->start,
|
iop_chan->mmr_base = devm_ioremap(&pdev->dev, res->start,
|
||||||
res->end - res->start);
|
resource_size(res));
|
||||||
if (!iop_chan->mmr_base) {
|
if (!iop_chan->mmr_base) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err_free_iop_chan;
|
goto err_free_iop_chan;
|
||||||
|
Loading…
Reference in New Issue
Block a user