@@ -475,7 +475,7 @@ static int __devinit am35x_probe(struct platform_device *pdev)
goto err0;
}
- musb = platform_device_alloc("musb-hdrc", -1);
+ musb = platform_device_alloc("musb-hdrc", pdev->id);
if (!musb) {
dev_err(&pdev->dev, "failed to allocate musb device\n");
goto err1;
@@ -478,7 +478,7 @@ static int __devinit bfin_probe(struct platform_device *pdev)
goto err0;
}
- musb = platform_device_alloc("musb-hdrc", -1);
+ musb = platform_device_alloc("musb-hdrc", pdev->id);
if (!musb) {
dev_err(&pdev->dev, "failed to allocate musb device\n");
goto err1;
@@ -496,7 +496,7 @@ static int __devinit da8xx_probe(struct platform_device *pdev)
goto err0;
}
- musb = platform_device_alloc("musb-hdrc", -1);
+ musb = platform_device_alloc("musb-hdrc", pdev->id);
if (!musb) {
dev_err(&pdev->dev, "failed to allocate musb device\n");
goto err1;
@@ -530,7 +530,7 @@ static int __devinit davinci_probe(struct platform_device *pdev)
goto err0;
}
- musb = platform_device_alloc("musb-hdrc", -1);
+ musb = platform_device_alloc("musb-hdrc", pdev->id);
if (!musb) {
dev_err(&pdev->dev, "failed to allocate musb device\n");
goto err1;
@@ -1867,6 +1867,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
int status;
struct musb *musb;
struct musb_hdrc_platform_data *plat = dev->platform_data;
+ struct platform_device *pdev = to_platform_device(dev);
/* The driver might handle more features than the board; OK.
* Fail when the board needs a feature that's not enabled.
@@ -1889,6 +1890,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
pm_runtime_enable(musb->controller);
spin_lock_init(&musb->lock);
+ musb->id = pdev->id;
musb->board_mode = plat->mode;
musb->board_set_power = plat->set_power;
musb->min_power = plat->min_power;
@@ -450,6 +450,8 @@ struct musb {
#ifdef MUSB_CONFIG_PROC_FS
struct proc_dir_entry *proc_entry;
#endif
+ /* id for multiple musb instances */
+ u8 id;
};
static inline struct musb *gadget_to_musb(struct usb_gadget *g)
@@ -535,7 +535,7 @@ static int __devinit dsps_create_musb_pdev(struct dsps_glue *glue, u8 id)
resources[1].name = "mc";
/* allocate the child platform device */
- musb = platform_device_alloc("musb-hdrc", -1);
+ musb = platform_device_alloc("musb-hdrc", pdev->id);
if (!musb) {
dev_err(dev, "failed to allocate musb device\n");
ret = -ENOMEM;
@@ -448,7 +448,7 @@ static int __devinit omap2430_probe(struct platform_device *pdev)
goto err0;
}
- musb = platform_device_alloc("musb-hdrc", -1);
+ musb = platform_device_alloc("musb-hdrc", pdev->id);
if (!musb) {
dev_err(&pdev->dev, "failed to allocate musb device\n");
goto err0;
@@ -1182,7 +1182,7 @@ static int __devinit tusb_probe(struct platform_device *pdev)
goto err0;
}
- musb = platform_device_alloc("musb-hdrc", -1);
+ musb = platform_device_alloc("musb-hdrc", pdev->id);
if (!musb) {
dev_err(&pdev->dev, "failed to allocate musb device\n");
goto err1;
@@ -74,7 +74,7 @@ static int __devinit ux500_probe(struct platform_device *pdev)
goto err0;
}
- musb = platform_device_alloc("musb-hdrc", -1);
+ musb = platform_device_alloc("musb-hdrc", pdev->id);
if (!musb) {
dev_err(&pdev->dev, "failed to allocate musb device\n");
goto err1;
Added 'id' field within 'struct musb' which can be used to determine the current instance of musb controller. Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> --- drivers/usb/musb/am35x.c | 2 +- drivers/usb/musb/blackfin.c | 2 +- drivers/usb/musb/da8xx.c | 2 +- drivers/usb/musb/davinci.c | 2 +- drivers/usb/musb/musb_core.c | 2 ++ drivers/usb/musb/musb_core.h | 2 ++ drivers/usb/musb/musb_dsps.c | 2 +- drivers/usb/musb/omap2430.c | 2 +- drivers/usb/musb/tusb6010.c | 2 +- drivers/usb/musb/ux500.c | 2 +- 10 files changed, 12 insertions(+), 8 deletions(-)