From: Greg Kroah-Hartman Date: Mon, 12 Nov 2012 01:12:27 +0000 (-0800) Subject: Merge tag 'musb-for-v3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi... X-Git-Tag: next-20121113~30^2~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3a3f2e50951faaac1c67b5c6c0c70dec5b150e9b;p=karo-tx-linux.git Merge tag 'musb-for-v3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next USB musb merge from Felipe: "usb: musb: patches for v3.8 merge window We have here the usual set of cleanups for the MUSB driver; a big set of patches converting platform_device_del() and platform_device_put() into platform_device_unregister(). Another big set was applied converting to module_platform_driver() macro in order to reduce some boilerplate code from all glue layers. Other than that, we had a series fixing one known silicon errata where we couldn't read a few registers. In order to fix that we're now using shadow variables for reads and only writing to the registers which are known to break functionality when read." --- 3a3f2e50951faaac1c67b5c6c0c70dec5b150e9b diff --cc drivers/usb/musb/musb_dsps.c index ff5f112053d2,e770f7984b5f..cf08966af5c2 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c @@@ -458,14 -489,24 +489,24 @@@ static int __devinit dsps_create_musb_p struct platform_device *musb; struct resource *res; struct resource resources[2]; - char res_name[10]; + char res_name[11]; - int ret, musbid; + int ret; - /* get memory resource */ - snprintf(res_name, sizeof(res_name), "musb%d", id); - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, res_name); + resources[0].start = dsps_control_module_phys[id]; + resources[0].end = resources[0].start + SZ_4 - 1; + resources[0].flags = IORESOURCE_MEM; + + glue->usb_ctrl[id] = devm_request_and_ioremap(&pdev->dev, resources); + if (glue->usb_ctrl[id] == NULL) { + dev_err(dev, "Failed to obtain usb_ctrl%d memory\n", id); + ret = -ENODEV; + goto err0; + } + + /* 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; }