diff options
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r-- | drivers/usb/musb/musb_core.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index d5af6b0d8af5..4a35745b30be 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -2055,15 +2055,6 @@ bad_config: | |||
2055 | 2055 | ||
2056 | } | 2056 | } |
2057 | 2057 | ||
2058 | return 0; | ||
2059 | |||
2060 | fail: | ||
2061 | if (musb->clock) | ||
2062 | clk_put(musb->clock); | ||
2063 | device_init_wakeup(dev, 0); | ||
2064 | musb_free(musb); | ||
2065 | return status; | ||
2066 | |||
2067 | #ifdef CONFIG_SYSFS | 2058 | #ifdef CONFIG_SYSFS |
2068 | status = device_create_file(dev, &dev_attr_mode); | 2059 | status = device_create_file(dev, &dev_attr_mode); |
2069 | status = device_create_file(dev, &dev_attr_vbus); | 2060 | status = device_create_file(dev, &dev_attr_vbus); |
@@ -2072,12 +2063,31 @@ fail: | |||
2072 | #endif /* CONFIG_USB_GADGET_MUSB_HDRC */ | 2063 | #endif /* CONFIG_USB_GADGET_MUSB_HDRC */ |
2073 | status = 0; | 2064 | status = 0; |
2074 | #endif | 2065 | #endif |
2066 | if (status) | ||
2067 | goto fail2; | ||
2075 | 2068 | ||
2076 | return status; | 2069 | return 0; |
2077 | 2070 | ||
2078 | fail2: | 2071 | fail2: |
2072 | #ifdef CONFIG_SYSFS | ||
2073 | device_remove_file(musb->controller, &dev_attr_mode); | ||
2074 | device_remove_file(musb->controller, &dev_attr_vbus); | ||
2075 | #ifdef CONFIG_USB_MUSB_OTG | ||
2076 | device_remove_file(musb->controller, &dev_attr_srp); | ||
2077 | #endif | ||
2078 | #endif | ||
2079 | musb_platform_exit(musb); | 2079 | musb_platform_exit(musb); |
2080 | goto fail; | 2080 | fail: |
2081 | dev_err(musb->controller, | ||
2082 | "musb_init_controller failed with status %d\n", status); | ||
2083 | |||
2084 | if (musb->clock) | ||
2085 | clk_put(musb->clock); | ||
2086 | device_init_wakeup(dev, 0); | ||
2087 | musb_free(musb); | ||
2088 | |||
2089 | return status; | ||
2090 | |||
2081 | } | 2091 | } |
2082 | 2092 | ||
2083 | /*-------------------------------------------------------------------------*/ | 2093 | /*-------------------------------------------------------------------------*/ |