diff options
author | Jingoo Han <jg1.han@samsung.com> | 2011-04-14 08:09:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-29 20:24:37 -0400 |
commit | 3c86c07baaa22e1ebae1922b5285f79a39e93d83 (patch) | |
tree | 72d3e20ce125a30cd864be0fa54aaeb773b068a1 /drivers/usb/host/ohci-s3c2410.c | |
parent | e7f84331c21408fecc872aaabc41c7b97fe15ae4 (diff) |
USB: ohci-s3c2410: use resource_size()
This patch uses the resource_size help function instead of
manually calculating the resource size. It can reduce the chance
of introducing off-by-one errors.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ohci-s3c2410.c')
-rw-r--r-- | drivers/usb/host/ohci-s3c2410.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index 16ec7da9237c..5837d218050d 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c | |||
@@ -353,7 +353,7 @@ static int usb_hcd_s3c2410_probe (const struct hc_driver *driver, | |||
353 | return -ENOMEM; | 353 | return -ENOMEM; |
354 | 354 | ||
355 | hcd->rsrc_start = dev->resource[0].start; | 355 | hcd->rsrc_start = dev->resource[0].start; |
356 | hcd->rsrc_len = dev->resource[0].end - dev->resource[0].start + 1; | 356 | hcd->rsrc_len = resource_size(&dev->resource[0]); |
357 | 357 | ||
358 | if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { | 358 | if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { |
359 | dev_err(&dev->dev, "request_mem_region failed\n"); | 359 | dev_err(&dev->dev, "request_mem_region failed\n"); |