From: Greg Kroah-Hartman Date: Tue, 11 Sep 2012 20:56:29 +0000 (-0700) Subject: Merge tag 'musb-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1cd572fc0c5f6887ea0542e2d3ec26625e2cdfb7;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git Merge tag 'musb-for-v3.7' of git://git./linux/kernel/git/balbi/usb into usb-next usb: musb: patches for v3.7 merge window Here we have a bunch of miscellaneous cleanups and fixes to the musb driver. It fixes a bunch of mistakes errors which nobody has triggered before, so I'm not Ccing stable tree. We are finally improving OMAP's VBUS/ID Mailbox usage so that we can introduce our PHY drivers properly. Also, we're adding support for multiple instances of the MUSB IP in the same SoC, as seen on some platforms from TI which have 2 MUSB instances. Other than that, we have some small fixes like not kicking DMA for a zero byte transfer, or properly handling NAK timeout on MUSB's host side, and the enabling of DMA Mode1 for any transfers which are aligned to wMaxPacketSize. All patches have been pending on mailing list for a long time and I don't expect any big surprises with this pull request. --- 1cd572fc0c5f6887ea0542e2d3ec26625e2cdfb7 diff --cc drivers/usb/musb/musb_dsps.c index c20b8776aaf,2785e28ec4a..444346e1e10 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c @@@ -480,12 -479,19 +480,19 @@@ static int __devinit dsps_create_musb_p ret = -ENODEV; goto err0; } - strcpy((u8 *)res->name, "mc"); res->parent = NULL; resources[1] = *res; + resources[1].name = "mc"; + /* get the musb id */ + musbid = musb_get_id(dev, GFP_KERNEL); + if (musbid < 0) { + dev_err(dev, "failed to allocate musb id\n"); + ret = -ENOMEM; + goto err0; + } /* allocate the child platform device */ - musb = platform_device_alloc("musb-hdrc", -1); + musb = platform_device_alloc("musb-hdrc", musbid); if (!musb) { dev_err(dev, "failed to allocate musb device\n"); ret = -ENOMEM; @@@ -573,14 -624,16 +618,19 @@@ static int __devinit dsps_probe(struct ret = pm_runtime_get_sync(&pdev->dev); if (ret < 0) { dev_err(&pdev->dev, "pm_runtime_get_sync FAILED"); + goto err2; + } + - /* create the child platform device for first instances of musb */ - ret = dsps_create_musb_pdev(glue, 0); - if (ret != 0) { - dev_err(&pdev->dev, "failed to create child pdev\n"); - goto err3; + /* create the child platform device for all instances of musb */ + for (i = 0; i < wrp->instances ; i++) { + ret = dsps_create_musb_pdev(glue, i); + if (ret != 0) { + dev_err(&pdev->dev, "failed to create child pdev\n"); + /* release resources of previously created instances */ + for (i--; i >= 0 ; i--) + dsps_delete_musb_pdev(glue, i); + goto err3; + } } return 0;