aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2008-11-13 01:46:37 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-07 12:59:53 -0500
commit0a2e5b9b8a3d205b565dec18d6fe39ef1aed75cc (patch)
tree864af256f1806a809072b40db8bb2f1e48bd2d29
parent3a407e7391767898027eb7030c41c78ebc7a785d (diff)
USB: m66592 and r8a66597 resource changes
Use the more common platform_get_resource() together with index instead of depending on the resource name and platform_get_resource_by_name(). Replace the resource_len() implementation with resource_size(). Signed-off-by: Magnus Damm <damm@igel.co.jp> Acked-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/gadget/m66592-udc.c9
-rw-r--r--drivers/usb/host/r8a66597-hcd.c8
2 files changed, 6 insertions, 11 deletions
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c
index 3a8879ec2061..43dcf9e1af6b 100644
--- a/drivers/usb/gadget/m66592-udc.c
+++ b/drivers/usb/gadget/m66592-udc.c
@@ -1546,8 +1546,6 @@ static void nop_completion(struct usb_ep *ep, struct usb_request *r)
1546{ 1546{
1547} 1547}
1548 1548
1549#define resource_len(r) (((r)->end - (r)->start) + 1)
1550
1551static int __init m66592_probe(struct platform_device *pdev) 1549static int __init m66592_probe(struct platform_device *pdev)
1552{ 1550{
1553 struct resource *res; 1551 struct resource *res;
@@ -1560,11 +1558,10 @@ static int __init m66592_probe(struct platform_device *pdev)
1560 int ret = 0; 1558 int ret = 0;
1561 int i; 1559 int i;
1562 1560
1563 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, 1561 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1564 (char *)udc_name);
1565 if (!res) { 1562 if (!res) {
1566 ret = -ENODEV; 1563 ret = -ENODEV;
1567 pr_err("platform_get_resource_byname error.\n"); 1564 pr_err("platform_get_resource error.\n");
1568 goto clean_up; 1565 goto clean_up;
1569 } 1566 }
1570 1567
@@ -1575,7 +1572,7 @@ static int __init m66592_probe(struct platform_device *pdev)
1575 goto clean_up; 1572 goto clean_up;
1576 } 1573 }
1577 1574
1578 reg = ioremap(res->start, resource_len(res)); 1575 reg = ioremap(res->start, resource_size(res));
1579 if (reg == NULL) { 1576 if (reg == NULL) {
1580 ret = -ENOMEM; 1577 ret = -ENOMEM;
1581 pr_err("ioremap error.\n"); 1578 pr_err("ioremap error.\n");
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index c21f14e0666a..319041205b57 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -2275,7 +2275,6 @@ static int __init_or_module r8a66597_remove(struct platform_device *pdev)
2275 return 0; 2275 return 0;
2276} 2276}
2277 2277
2278#define resource_len(r) (((r)->end - (r)->start) + 1)
2279static int __init r8a66597_probe(struct platform_device *pdev) 2278static int __init r8a66597_probe(struct platform_device *pdev)
2280{ 2279{
2281#if defined(CONFIG_SUPERH_ON_CHIP_R8A66597) && defined(CONFIG_HAVE_CLK) 2280#if defined(CONFIG_SUPERH_ON_CHIP_R8A66597) && defined(CONFIG_HAVE_CLK)
@@ -2296,11 +2295,10 @@ static int __init r8a66597_probe(struct platform_device *pdev)
2296 goto clean_up; 2295 goto clean_up;
2297 } 2296 }
2298 2297
2299 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, 2298 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2300 (char *)hcd_name);
2301 if (!res) { 2299 if (!res) {
2302 ret = -ENODEV; 2300 ret = -ENODEV;
2303 dev_err(&pdev->dev, "platform_get_resource_byname error.\n"); 2301 dev_err(&pdev->dev, "platform_get_resource error.\n");
2304 goto clean_up; 2302 goto clean_up;
2305 } 2303 }
2306 2304
@@ -2315,7 +2313,7 @@ static int __init r8a66597_probe(struct platform_device *pdev)
2315 irq = ires->start; 2313 irq = ires->start;
2316 irq_trigger = ires->flags & IRQF_TRIGGER_MASK; 2314 irq_trigger = ires->flags & IRQF_TRIGGER_MASK;
2317 2315
2318 reg = ioremap(res->start, resource_len(res)); 2316 reg = ioremap(res->start, resource_size(res));
2319 if (reg == NULL) { 2317 if (reg == NULL) {
2320 ret = -ENOMEM; 2318 ret = -ENOMEM;
2321 dev_err(&pdev->dev, "ioremap error.\n"); 2319 dev_err(&pdev->dev, "ioremap error.\n");