2009-12-12 00:07:30

by Hartley Sweeten

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

Use resource_size() for ioremap.

Signed-off-by: H Hartley Sweeten <[email protected]>
Cc: Ian Molton <[email protected]>
Cc: Samuel Ortiz <[email protected]>

---

diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
index 0a255c1..20bbd1d 100644
--- a/drivers/mfd/t7l66xb.c
+++ b/drivers/mfd/t7l66xb.c
@@ -341,7 +341,7 @@ static int t7l66xb_probe(struct platform_device *dev)
if (ret)
goto err_request_scr;

- t7l66xb->scr = ioremap(rscr->start, rscr->end - rscr->start + 1);
+ t7l66xb->scr = ioremap(rscr->start, resource_size(rscr));
if (!t7l66xb->scr) {
ret = -ENOMEM;
goto err_ioremap;


2010-01-05 19:01:26

by Samuel Ortiz

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

Hi Hartley,

On Fri, Dec 11, 2009 at 07:07:32PM -0500, H Hartley Sweeten wrote:
> Use resource_size() for ioremap.
Patch applied, thanks.


> Signed-off-by: H Hartley Sweeten <[email protected]>
> Cc: Ian Molton <[email protected]>
> Cc: Samuel Ortiz <[email protected]>
>
> ---
>
> diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
> index 0a255c1..20bbd1d 100644
> --- a/drivers/mfd/t7l66xb.c
> +++ b/drivers/mfd/t7l66xb.c
> @@ -341,7 +341,7 @@ static int t7l66xb_probe(struct platform_device *dev)
> if (ret)
> goto err_request_scr;
>
> - t7l66xb->scr = ioremap(rscr->start, rscr->end - rscr->start + 1);
> + t7l66xb->scr = ioremap(rscr->start, resource_size(rscr));
> if (!t7l66xb->scr) {
> ret = -ENOMEM;
> goto err_ioremap;

--
Intel Open Source Technology Centre
http://oss.intel.com/