[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100105190231.GG4274@sortiz.org>
Date: Tue, 5 Jan 2010 20:02:31 +0100
From: Samuel Ortiz <sameo@...ux.intel.com>
To: H Hartley Sweeten <hartleys@...ionengravers.com>
Cc: kernel list <linux-kernel@...r.kernel.org>,
Ben Dooks <ben-linux@...ff.org>
Subject: Re: [PATCH] sm501.c: use resource_size()
On Fri, Dec 11, 2009 at 06:55:41PM -0500, H Hartley Sweeten wrote:
> The requested memory region is smaller than the actual ioremap().
> Use resource_size() to get the correct size.
Patch applied, thanks.
> Signed-off-by: H Hartley Sweeten <hsweeten@...ionengravers.com>
> Cc: Ben Dooks <ben-linux@...ff.org>
> Cc: Samuel Ortiz <sameo@...ux.intel.com>
>
> ---
>
> diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
> index 0cc5eef..dc9ea95 100644
> --- a/drivers/mfd/sm501.c
> +++ b/drivers/mfd/sm501.c
> @@ -1430,7 +1430,7 @@ static int __devinit sm501_plat_probe(struct platform_device *dev)
> }
>
> sm->regs_claim = request_mem_region(sm->io_res->start,
> - 0x100, "sm501");
> + resource_size(sm->io_res), "sm501");
>
> if (sm->regs_claim == NULL) {
> dev_err(&dev->dev, "cannot claim registers\n");
> @@ -1440,8 +1440,7 @@ static int __devinit sm501_plat_probe(struct platform_device *dev)
>
> platform_set_drvdata(dev, sm);
>
> - sm->regs = ioremap(sm->io_res->start,
> - (sm->io_res->end - sm->io_res->start) - 1);
> + sm->regs = ioremap(sm->io_res->start, resource_size(sm->io_res));
>
> if (sm->regs == NULL) {
> dev_err(&dev->dev, "cannot remap registers\n");
> @@ -1645,7 +1644,7 @@ static int __devinit sm501_pci_probe(struct pci_dev *dev,
> sm->mem_res = &dev->resource[0];
>
> sm->regs_claim = request_mem_region(sm->io_res->start,
> - 0x100, "sm501");
> + resource_size(sm->io_res), "sm501");
> if (sm->regs_claim == NULL) {
> dev_err(&dev->dev, "cannot claim registers\n");
> err= -EBUSY;
--
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists