diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-18 02:43:52 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-18 02:43:52 +0400 |
commit | 0cfd81031a26717fe14380d18275f8e217571615 (patch) | |
tree | 78a84e4cb97e7f45eb77dc0fbd8857a5dd717869 /drivers/usb/musb/musb_core.c | |
parent | f7ea4a4ba84f382e8eb143e435551de0feee5b4b (diff) | |
parent | 802f389a2cc6e2771b8de915ac241456d41eb79e (diff) | |
download | linux-0cfd81031a26717fe14380d18275f8e217571615.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (94 commits)
USB: remove err() macro from more usb drivers
USB: remove err() macro from usb misc drivers
USB: remove err() macro from usb core code
USB: remove err() macro from usb class drivers
USB: remove use of err() in drivers/usb/serial
USB: remove info() macro from usb mtd drivers
USB: remove info() macro from usb input drivers
USB: remove info() macro from usb network drivers
USB: remove info() macro from remaining usb drivers
USB: remove info() macro from usb/misc drivers
USB: remove info() macro from usb/serial drivers
USB: remove warn macro from HID core
USB: remove warn() macro from usb drivers
USB: remove warn() macro from usb net drivers
USB: remove warn() macro from usb media drivers
USB: remove warn() macro from usb input drivers
usb/fsl_qe_udc: clear data toggle on clear halt request
usb/fsl_qe_udc: fix response to get status request
fsl_usb2_udc: Fix oops on probe failure.
fsl_usb2_udc: Add a wmb before priming endpoint.
...
Diffstat (limited to 'drivers/usb/musb/musb_core.c')
-rw-r--r-- | drivers/usb/musb/musb_core.c | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 128e949db47c..4a35745b30be 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -82,9 +82,9 @@ /* * This gets many kinds of configuration information: * - Kconfig for everything user-configurable - * - <asm/arch/hdrc_cnf.h> for SOC or family details * - platform_device for addressing, irq, and platform_data * - platform_data is mostly for board-specific informarion + * (plus recentrly, SOC or family details) * * Most of the conditional compilation will (someday) vanish. */ @@ -974,9 +974,9 @@ static void musb_shutdown(struct platform_device *pdev) /* * The silicon either has hard-wired endpoint configurations, or else * "dynamic fifo" sizing. The driver has support for both, though at this - * writing only the dynamic sizing is very well tested. We use normal - * idioms to so both modes are compile-tested, but dead code elimination - * leaves only the relevant one in the object file. + * writing only the dynamic sizing is very well tested. Since we switched + * away from compile-time hardware parameters, we can no longer rely on + * dead code elimination to leave only the relevant one in the object file. * * We don't currently use dynamic fifo setup capability to do anything * more than selecting one of a bunch of predefined configurations. @@ -1806,6 +1806,7 @@ allocate_instance(struct device *dev, musb->ctrl_base = mbase; musb->nIrq = -ENODEV; musb->config = config; + BUG_ON(musb->config->num_eps > MUSB_C_NUM_EPS); for (epnum = 0, ep = musb->endpoints; epnum < musb->config->num_eps; epnum++, ep++) { @@ -2054,15 +2055,6 @@ bad_config: } - return 0; - -fail: - if (musb->clock) - clk_put(musb->clock); - device_init_wakeup(dev, 0); - musb_free(musb); - return status; - #ifdef CONFIG_SYSFS status = device_create_file(dev, &dev_attr_mode); status = device_create_file(dev, &dev_attr_vbus); @@ -2071,12 +2063,31 @@ fail: #endif /* CONFIG_USB_GADGET_MUSB_HDRC */ status = 0; #endif + if (status) + goto fail2; - return status; + return 0; fail2: +#ifdef CONFIG_SYSFS + device_remove_file(musb->controller, &dev_attr_mode); + device_remove_file(musb->controller, &dev_attr_vbus); +#ifdef CONFIG_USB_MUSB_OTG + device_remove_file(musb->controller, &dev_attr_srp); +#endif +#endif musb_platform_exit(musb); - goto fail; +fail: + dev_err(musb->controller, + "musb_init_controller failed with status %d\n", status); + + if (musb->clock) + clk_put(musb->clock); + device_init_wakeup(dev, 0); + musb_free(musb); + + return status; + } /*-------------------------------------------------------------------------*/ |