diff mbox

[1/2] of: address: use resource_size helper

Message ID 1311364042-8325-1-git-send-email-balbi@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Felipe Balbi July 22, 2011, 7:47 p.m. UTC
that should be the approved way of calculating
the size of resources. No functional changes.

Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/of/address.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Grant Likely Aug. 1, 2011, 11:55 a.m. UTC | #1
On Fri, Jul 22, 2011 at 10:47:21PM +0300, Felipe Balbi wrote:
> that should be the approved way of calculating
> the size of resources. No functional changes.
> 
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Signed-off-by: Felipe Balbi <balbi@ti.com>

Applied, thanks.

> ---
>  drivers/of/address.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/of/address.c b/drivers/of/address.c
> index deefc0c..6e7b2cf 100644
> --- a/drivers/of/address.c
> +++ b/drivers/of/address.c
> @@ -624,6 +624,6 @@ void __iomem *of_iomap(struct device_node *np, int index)
>  	if (of_address_to_resource(np, index, &res))
>  		return NULL;
>  
> -	return ioremap(res.start, 1 + res.end - res.start);
> +	return ioremap(res.start, resource_size(&res));
>  }
>  EXPORT_SYMBOL(of_iomap);
> -- 
> 1.7.6
>
diff mbox

Patch

diff --git a/drivers/of/address.c b/drivers/of/address.c
index deefc0c..6e7b2cf 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -624,6 +624,6 @@  void __iomem *of_iomap(struct device_node *np, int index)
 	if (of_address_to_resource(np, index, &res))
 		return NULL;
 
-	return ioremap(res.start, 1 + res.end - res.start);
+	return ioremap(res.start, resource_size(&res));
 }
 EXPORT_SYMBOL(of_iomap);