aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/musb/musb_core.c')
-rw-r--r--drivers/usb/musb/musb_core.c38
1 files changed, 15 insertions, 23 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index d68ec6daf33..c5b8f0296fc 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -114,23 +114,14 @@
114 114
115 115
116 116
117#if MUSB_DEBUG > 0 117unsigned debug;
118unsigned debug = MUSB_DEBUG; 118module_param(debug, uint, S_IRUGO | S_IWUSR);
119module_param(debug, uint, 0); 119MODULE_PARM_DESC(debug, "Debug message level. Default = 0");
120MODULE_PARM_DESC(debug, "initial debug message level");
121
122#define MUSB_VERSION_SUFFIX "/dbg"
123#endif
124 120
125#define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia" 121#define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia"
126#define DRIVER_DESC "Inventra Dual-Role USB Controller Driver" 122#define DRIVER_DESC "Inventra Dual-Role USB Controller Driver"
127 123
128#define MUSB_VERSION_BASE "6.0" 124#define MUSB_VERSION "6.0"
129
130#ifndef MUSB_VERSION_SUFFIX
131#define MUSB_VERSION_SUFFIX ""
132#endif
133#define MUSB_VERSION MUSB_VERSION_BASE MUSB_VERSION_SUFFIX
134 125
135#define DRIVER_INFO DRIVER_DESC ", v" MUSB_VERSION 126#define DRIVER_INFO DRIVER_DESC ", v" MUSB_VERSION
136 127
@@ -2037,6 +2028,8 @@ bad_config:
2037 musb->xceiv.state = OTG_STATE_A_IDLE; 2028 musb->xceiv.state = OTG_STATE_A_IDLE;
2038 2029
2039 status = usb_add_hcd(musb_to_hcd(musb), -1, 0); 2030 status = usb_add_hcd(musb_to_hcd(musb), -1, 0);
2031 if (status)
2032 goto fail;
2040 2033
2041 DBG(1, "%s mode, status %d, devctl %02x %c\n", 2034 DBG(1, "%s mode, status %d, devctl %02x %c\n",
2042 "HOST", status, 2035 "HOST", status,
@@ -2051,6 +2044,8 @@ bad_config:
2051 musb->xceiv.state = OTG_STATE_B_IDLE; 2044 musb->xceiv.state = OTG_STATE_B_IDLE;
2052 2045
2053 status = musb_gadget_setup(musb); 2046 status = musb_gadget_setup(musb);
2047 if (status)
2048 goto fail;
2054 2049
2055 DBG(1, "%s mode, status %d, dev%02x\n", 2050 DBG(1, "%s mode, status %d, dev%02x\n",
2056 is_otg_enabled(musb) ? "OTG" : "PERIPHERAL", 2051 is_otg_enabled(musb) ? "OTG" : "PERIPHERAL",
@@ -2059,16 +2054,14 @@ bad_config:
2059 2054
2060 } 2055 }
2061 2056
2062 if (status == 0) 2057 return 0;
2063 musb_debug_create("driver/musb_hdrc", musb); 2058
2064 else {
2065fail: 2059fail:
2066 if (musb->clock) 2060 if (musb->clock)
2067 clk_put(musb->clock); 2061 clk_put(musb->clock);
2068 device_init_wakeup(dev, 0); 2062 device_init_wakeup(dev, 0);
2069 musb_free(musb); 2063 musb_free(musb);
2070 return status; 2064 return status;
2071 }
2072 2065
2073#ifdef CONFIG_SYSFS 2066#ifdef CONFIG_SYSFS
2074 status = device_create_file(dev, &dev_attr_mode); 2067 status = device_create_file(dev, &dev_attr_mode);
@@ -2131,7 +2124,6 @@ static int __devexit musb_remove(struct platform_device *pdev)
2131 * - OTG mode: both roles are deactivated (or never-activated) 2124 * - OTG mode: both roles are deactivated (or never-activated)
2132 */ 2125 */
2133 musb_shutdown(pdev); 2126 musb_shutdown(pdev);
2134 musb_debug_delete("driver/musb_hdrc", musb);
2135#ifdef CONFIG_USB_MUSB_HDRC_HCD 2127#ifdef CONFIG_USB_MUSB_HDRC_HCD
2136 if (musb->board_mode == MUSB_HOST) 2128 if (musb->board_mode == MUSB_HOST)
2137 usb_remove_hcd(musb_to_hcd(musb)); 2129 usb_remove_hcd(musb_to_hcd(musb));