Input: xilinx_ps2 - use resource_size
authorTobias Klauser <tklauser@distanz.ch>
Fri, 22 Jan 2010 07:52:37 +0000 (23:52 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 25 Jan 2010 06:41:49 +0000 (22:41 -0800)
Use the resource_size inline function instead of manually calculating
the resource size.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: John Linn <john.linn@xilinx.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/serio/xilinx_ps2.c

index 78c64fb8a4b0d21050892cdd26ec7cab27760827..8298e1f68234df7cbd33afbc4d452595155530c0 100644 (file)
@@ -270,7 +270,7 @@ static int __devinit xps2_of_probe(struct of_device *ofdev,
        drvdata->irq = r_irq.start;
 
        phys_addr = r_mem.start;
-       remap_size = r_mem.end - r_mem.start + 1;
+       remap_size = resource_size(&r_mem);
        if (!request_mem_region(phys_addr, remap_size, DRIVER_NAME)) {
                dev_err(dev, "Couldn't lock memory region at 0x%08llX\n",
                        (unsigned long long)phys_addr);
@@ -344,7 +344,7 @@ static int __devexit xps2_of_remove(struct of_device *of_dev)
        if (of_address_to_resource(of_dev->node, 0, &r_mem))
                dev_err(dev, "invalid address\n");
        else
-               release_mem_region(r_mem.start, r_mem.end - r_mem.start + 1);
+               release_mem_region(r_mem.start, resource_size(&r_mem));
 
        kfree(drvdata);