USB: ohci-at91: use resource_size() for memory/io resource length
authorNicolas Ferre <nicolas.ferre@atmel.com>
Wed, 9 May 2012 08:49:41 +0000 (10:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 May 2012 22:20:45 +0000 (15:20 -0700)
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ohci-at91.c

index 476fb4d3e45e1b6c2e06ac2db1aa0093ff4134ec..d4608c2d5b64bb584bd81fa3f4155b05790cae3f 100644 (file)
@@ -129,7 +129,7 @@ static int __devinit usb_hcd_at91_probe(const struct hc_driver *driver,
        if (!hcd)
                return -ENOMEM;
        hcd->rsrc_start = pdev->resource[0].start;
-       hcd->rsrc_len = pdev->resource[0].end - pdev->resource[0].start + 1;
+       hcd->rsrc_len = resource_size(&pdev->resource[0]);
 
        if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
                pr_debug("request_mem_region failed\n");