diff options
author | Afzal Mohammed <afzal@ti.com> | 2012-11-02 22:02:41 +0530 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-11-06 15:01:39 +0200 |
commit | 3e594b18f1871a758812aa5e705873012cabf0e8 (patch) | |
tree | ac5095b85e77555f74c4ebc7637afa8ebe1b47d9 /drivers/usb/musb | |
parent | 3b46dd76a9b3ce25a5177f61eed844f85ddb3ca6 (diff) |
usb: musb: dsps: get resources by index
dsps wrapper is now dt only. This requires that resources be obtained
using index and not name, modify accordingly.
Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r-- | drivers/usb/musb/musb_dsps.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index 72d74601798..b159fc92f84 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c @@ -449,22 +449,20 @@ static int __devinit dsps_create_musb_pdev(struct dsps_glue *glue, u8 id) char res_name[10]; int ret; - /* get memory resource */ - sprintf(res_name, "musb%d", id); - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, res_name); + /* first resource is for usbss, so start index from 1 */ + res = platform_get_resource(pdev, IORESOURCE_MEM, id + 1); if (!res) { - dev_err(dev, "%s get mem resource failed\n", res_name); + dev_err(dev, "failed to get memory for instance %d\n", id); ret = -ENODEV; goto err0; } res->parent = NULL; resources[0] = *res; - /* get irq resource */ - sprintf(res_name, "musb%d-irq", id); - res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, res_name); + /* first resource is for usbss, so start index from 1 */ + res = platform_get_resource(pdev, IORESOURCE_IRQ, id + 1); if (!res) { - dev_err(dev, "%s get irq resource failed\n", res_name); + dev_err(dev, "failed to get irq for instance %d\n", id); ret = -ENODEV; goto err0; } |