mfd: fix htc-egpio iomem resource handling using resource_size
authorPhilipp Zabel <philipp.zabel@gmail.com>
Wed, 4 Feb 2009 20:27:48 +0000 (21:27 +0100)
committerSamuel Ortiz <samuel@sortiz.org>
Tue, 17 Feb 2009 08:00:14 +0000 (09:00 +0100)
Fixes an off-by-one error in the iomem resource mapping.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
drivers/mfd/htc-egpio.c

index 194df7b8256c78471ddf7580754ebc9d28e8750b..aa266e1f69b255875ee5b98e67988b31019fcf18 100644 (file)
@@ -286,7 +286,7 @@ static int __init egpio_probe(struct platform_device *pdev)
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res)
                goto fail;
-       ei->base_addr = ioremap_nocache(res->start, res->end - res->start);
+       ei->base_addr = ioremap_nocache(res->start, resource_size(res));
        if (!ei->base_addr)
                goto fail;
        pr_debug("EGPIO phys=%08x virt=%p\n", (u32)res->start, ei->base_addr);