diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2013-08-01 10:07:48 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-09-17 11:38:52 -0400 |
commit | d2ff405960a023a110fd5a6e82ba19d850d94db4 (patch) | |
tree | 1c563a074fc8e1a51875db1bf388ac1e4c97e51a /drivers/usb | |
parent | 5f5610f69be3a925b1f79af27150bb7377bc9ad6 (diff) |
usb: gadget: cdc2: fix conversion to new interface of f_ecm
This fixes commit a38a275030086d95306555e544fc7c0e65ccd00e
(usb: gadget: cdc2: convert to new interface of f_ecm)
The invocation of usb_get_function_instance() is in cdc_bind()
and should not be repeated in cdc_do_config().
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/cdc2.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/drivers/usb/gadget/cdc2.c b/drivers/usb/gadget/cdc2.c index 5a5acf22c694..e126b6b248e6 100644 --- a/drivers/usb/gadget/cdc2.c +++ b/drivers/usb/gadget/cdc2.c | |||
@@ -113,12 +113,6 @@ static int __init cdc_do_config(struct usb_configuration *c) | |||
113 | c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; | 113 | c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; |
114 | } | 114 | } |
115 | 115 | ||
116 | fi_ecm = usb_get_function_instance("ecm"); | ||
117 | if (IS_ERR(fi_ecm)) { | ||
118 | status = PTR_ERR(fi_ecm); | ||
119 | goto err_func_ecm; | ||
120 | } | ||
121 | |||
122 | f_ecm = usb_get_function(fi_ecm); | 116 | f_ecm = usb_get_function(fi_ecm); |
123 | if (IS_ERR(f_ecm)) { | 117 | if (IS_ERR(f_ecm)) { |
124 | status = PTR_ERR(f_ecm); | 118 | status = PTR_ERR(f_ecm); |
@@ -129,35 +123,24 @@ static int __init cdc_do_config(struct usb_configuration *c) | |||
129 | if (status) | 123 | if (status) |
130 | goto err_add_ecm; | 124 | goto err_add_ecm; |
131 | 125 | ||
132 | fi_serial = usb_get_function_instance("acm"); | ||
133 | if (IS_ERR(fi_serial)) { | ||
134 | status = PTR_ERR(fi_serial); | ||
135 | goto err_get_acm; | ||
136 | } | ||
137 | |||
138 | f_acm = usb_get_function(fi_serial); | 126 | f_acm = usb_get_function(fi_serial); |
139 | if (IS_ERR(f_acm)) { | 127 | if (IS_ERR(f_acm)) { |
140 | status = PTR_ERR(f_acm); | 128 | status = PTR_ERR(f_acm); |
141 | goto err_func_acm; | 129 | goto err_get_acm; |
142 | } | 130 | } |
143 | 131 | ||
144 | status = usb_add_function(c, f_acm); | 132 | status = usb_add_function(c, f_acm); |
145 | if (status) | 133 | if (status) |
146 | goto err_add_acm; | 134 | goto err_add_acm; |
147 | |||
148 | return 0; | 135 | return 0; |
149 | 136 | ||
150 | err_add_acm: | 137 | err_add_acm: |
151 | usb_put_function(f_acm); | 138 | usb_put_function(f_acm); |
152 | err_func_acm: | ||
153 | usb_put_function_instance(fi_serial); | ||
154 | err_get_acm: | 139 | err_get_acm: |
155 | usb_remove_function(c, f_ecm); | 140 | usb_remove_function(c, f_ecm); |
156 | err_add_ecm: | 141 | err_add_ecm: |
157 | usb_put_function(f_ecm); | 142 | usb_put_function(f_ecm); |
158 | err_get_ecm: | 143 | err_get_ecm: |
159 | usb_put_function_instance(fi_ecm); | ||
160 | err_func_ecm: | ||
161 | return status; | 144 | return status; |
162 | } | 145 | } |
163 | 146 | ||