pxa168fb: fix incorrect resource calculation
authorDan Carpenter <error27@gmail.com>
Mon, 22 Mar 2010 12:10:35 +0000 (15:10 +0300)
committerEric Miao <eric.y.miao@gmail.com>
Mon, 22 Mar 2010 12:30:17 +0000 (20:30 +0800)
The size calculation is not correct.  It should be end - start + 1.
Use resource_size() to caculate it.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
drivers/video/pxa168fb.c

index 75285d3f393cba74c77eb35017e98b229d639769..c91a7f70f7b086f56882ba07f97ba38e314adfd6 100644 (file)
@@ -668,7 +668,7 @@ static int __init pxa168fb_probe(struct platform_device *pdev)
        /*
         * Map LCD controller registers.
         */
-       fbi->reg_base = ioremap_nocache(res->start, res->end - res->start);
+       fbi->reg_base = ioremap_nocache(res->start, resource_size(res));
        if (fbi->reg_base == NULL) {
                ret = -ENOMEM;
                goto failed;