2009-12-11 01:29:49

by Hartley Sweeten

[permalink] [raw]
Subject: [PATCH] at_hdmac.c: use resource_size()

Use resource_size() for ioremap.

Signed-off-by: H Hartley Sweeten <[email protected]>
Cc: Nicolas Ferre <[email protected]>
---

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index c52ac9e..e16057b 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1012,7 +1012,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
atdma->dma_common.cap_mask = pdata->cap_mask;
atdma->all_chan_mask = (1 << pdata->nr_channels) - 1;

- size = io->end - io->start + 1;
+ size = resource_size(io);
if (!request_mem_region(io->start, size, pdev->dev.driver->name)) {
err = -EBUSY;
goto err_kfree;


2009-12-11 09:03:14

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [PATCH] at_hdmac.c: use resource_size()

H Hartley Sweeten :
> Use resource_size() for ioremap.
>
> Signed-off-by: H Hartley Sweeten <[email protected]>
> Cc: Nicolas Ferre <[email protected]>

Acked-by: Nicolas Ferre <[email protected]>

> ---
>
> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
> index c52ac9e..e16057b 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c
> @@ -1012,7 +1012,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
> atdma->dma_common.cap_mask = pdata->cap_mask;
> atdma->all_chan_mask = (1 << pdata->nr_channels) - 1;
>
> - size = io->end - io->start + 1;
> + size = resource_size(io);
> if (!request_mem_region(io->start, size, pdev->dev.driver->name)) {
> err = -EBUSY;
> goto err_kfree;
>


--
Nicolas Ferre