diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2009-12-14 18:22:42 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:53:18 -0500 |
commit | 1f141ca2b1f40088203fba061cc7b1f8da7c38ab (patch) | |
tree | 95d0031f3f010ab08ffa910d8f4e4e283309d49e /drivers | |
parent | f65c3540d316982c906e6ece7ccad00bba84574e (diff) |
USB: ehci-au1xxx.c: use platform_get_resource() and resource_size()
Use platform_get_resource() to fetch the memory resource and
resource_size() for calculate the length.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/ehci-au1xxx.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-au1xxx.c b/drivers/usb/host/ehci-au1xxx.c index dbfb482a94e3..e3a74e75e822 100644 --- a/drivers/usb/host/ehci-au1xxx.c +++ b/drivers/usb/host/ehci-au1xxx.c | |||
@@ -121,6 +121,7 @@ static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev) | |||
121 | { | 121 | { |
122 | struct usb_hcd *hcd; | 122 | struct usb_hcd *hcd; |
123 | struct ehci_hcd *ehci; | 123 | struct ehci_hcd *ehci; |
124 | struct resource *res; | ||
124 | int ret; | 125 | int ret; |
125 | 126 | ||
126 | if (usb_disabled()) | 127 | if (usb_disabled()) |
@@ -144,8 +145,9 @@ static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev) | |||
144 | if (!hcd) | 145 | if (!hcd) |
145 | return -ENOMEM; | 146 | return -ENOMEM; |
146 | 147 | ||
147 | hcd->rsrc_start = pdev->resource[0].start; | 148 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
148 | hcd->rsrc_len = pdev->resource[0].end - pdev->resource[0].start + 1; | 149 | hcd->rsrc_start = res->start; |
150 | hcd->rsrc_len = resource_size(res); | ||
149 | 151 | ||
150 | if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { | 152 | if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { |
151 | pr_debug("request_mem_region failed"); | 153 | pr_debug("request_mem_region failed"); |