goldfish_battery: Use resource_size()
authorSilviu-Mihai Popescu <silviupopescu1990@gmail.com>
Sun, 17 Mar 2013 08:01:34 +0000 (10:01 +0200)
committerAnton Vorontsov <anton@enomsg.org>
Mon, 1 Apr 2013 06:39:40 +0000 (23:39 -0700)
This uses the resource_size() function instead of explicit computation.

Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
Signed-off-by: Andrei Epure <epure.andrei@gmail.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
drivers/power/goldfish_battery.c

index c10f460..29eba88 100644 (file)
@@ -178,7 +178,7 @@ static int goldfish_battery_probe(struct platform_device *pdev)
                return -ENODEV;
        }
 
-       data->reg_base = devm_ioremap(&pdev->dev, r->start, r->end - r->start + 1);
+       data->reg_base = devm_ioremap(&pdev->dev, r->start, resource_size(r));
        if (data->reg_base == NULL) {
                dev_err(&pdev->dev, "unable to remap MMIO\n");
                return -ENOMEM;