drivers: net: irda: use resource_size() in au1k_ir.c
authorSilviu-Mihai Popescu <silviupopescu1990@gmail.com>
Sat, 16 Mar 2013 21:03:46 +0000 (21:03 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 Mar 2013 18:27:37 +0000 (14:27 -0400)
This uses the resource_size() function instead of explicit computation.

Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/irda/au1k_ir.c

index b5151e4ced612b0847abe72327d6f483d13757fe..56f1e6d6e4eb6ca20b89a067d7f2647904a5ad99 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/slab.h>
 #include <linux/time.h>
 #include <linux/types.h>
+#include <linux/ioport.h>
 
 #include <net/irda/irda.h>
 #include <net/irda/irmod.h>
@@ -882,12 +883,12 @@ static int au1k_irda_probe(struct platform_device *pdev)
                goto out;
 
        err = -EBUSY;
-       aup->ioarea = request_mem_region(r->start, r->end - r->start + 1,
+       aup->ioarea = request_mem_region(r->start, resource_size(r),
                                         pdev->name);
        if (!aup->ioarea)
                goto out;
 
-       aup->iobase = ioremap_nocache(r->start, r->end - r->start + 1);
+       aup->iobase = ioremap_nocache(r->start, resource_size(r));
        if (!aup->iobase)
                goto out2;