Use resource_size() for ioremap.
Signed-off-by: H Hartley Sweeten <[email protected]>
Cc: Guennadi Liakhovetski <[email protected]>
---
diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c
index 9a5bc1a..bfa2126 100644
--- a/drivers/dma/ipu/ipu_idmac.c
+++ b/drivers/dma/ipu/ipu_idmac.c
@@ -1771,16 +1771,14 @@ static int __init ipu_probe(struct platform_device *pdev)
ipu_data.irq_fn, ipu_data.irq_err, ipu_data.irq_base);
/* Remap IPU common registers */
- ipu_data.reg_ipu = ioremap(mem_ipu->start,
- mem_ipu->end - mem_ipu->start + 1);
+ ipu_data.reg_ipu = ioremap(mem_ipu->start, resource_size(mem_ipu));
if (!ipu_data.reg_ipu) {
ret = -ENOMEM;
goto err_ioremap_ipu;
}
/* Remap Image Converter and Image DMA Controller registers */
- ipu_data.reg_ic = ioremap(mem_ic->start,
- mem_ic->end - mem_ic->start + 1);
+ ipu_data.reg_ic = ioremap(mem_ic->start, resource_size(mem_ic));
if (!ipu_data.reg_ic) {
ret = -ENOMEM;
goto err_ioremap_ic;
On Mon, 23 Nov 2009, H Hartley Sweeten wrote:
> Use resource_size() for ioremap.
>
> Signed-off-by: H Hartley Sweeten <[email protected]>
> Cc: Guennadi Liakhovetski <[email protected]>
Acked-by: Guennadi Liakhovetski <[email protected]>
>
> ---
>
> diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c
> index 9a5bc1a..bfa2126 100644
> --- a/drivers/dma/ipu/ipu_idmac.c
> +++ b/drivers/dma/ipu/ipu_idmac.c
> @@ -1771,16 +1771,14 @@ static int __init ipu_probe(struct platform_device *pdev)
> ipu_data.irq_fn, ipu_data.irq_err, ipu_data.irq_base);
>
> /* Remap IPU common registers */
> - ipu_data.reg_ipu = ioremap(mem_ipu->start,
> - mem_ipu->end - mem_ipu->start + 1);
> + ipu_data.reg_ipu = ioremap(mem_ipu->start, resource_size(mem_ipu));
> if (!ipu_data.reg_ipu) {
> ret = -ENOMEM;
> goto err_ioremap_ipu;
> }
>
> /* Remap Image Converter and Image DMA Controller registers */
> - ipu_data.reg_ic = ioremap(mem_ic->start,
> - mem_ic->end - mem_ic->start + 1);
> + ipu_data.reg_ic = ioremap(mem_ic->start, resource_size(mem_ic));
> if (!ipu_data.reg_ic) {
> ret = -ENOMEM;
> goto err_ioremap_ic;
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/