diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2013-07-26 08:37:13 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-07-29 07:15:18 -0400 |
commit | 8abc6fa163d40bccc80c7b1f821f2579ab26864d (patch) | |
tree | 7b79027f819f5727ca5168193727242a6fee1b47 /drivers/usb/gadget/multi.c | |
parent | 3b45b2a2ad3546591cb4407b1c66921b2ee158a8 (diff) |
usb: gadget: multi: fix error return code in cdc_do_config()
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.
Introduced by commit 59835a (usb: gadget: multi: use
function framework for ACM.)
Make rndis_do_config() consistent with cdc_do_config() in the way it
handles returning the PTR_ERR(f_acm_*).
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/multi.c')
-rw-r--r-- | drivers/usb/gadget/multi.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c index 032b96a51ce4..2a1ebefd8f9e 100644 --- a/drivers/usb/gadget/multi.c +++ b/drivers/usb/gadget/multi.c | |||
@@ -160,10 +160,8 @@ static __init int rndis_do_config(struct usb_configuration *c) | |||
160 | return ret; | 160 | return ret; |
161 | 161 | ||
162 | f_acm_rndis = usb_get_function(fi_acm); | 162 | f_acm_rndis = usb_get_function(fi_acm); |
163 | if (IS_ERR(f_acm_rndis)) { | 163 | if (IS_ERR(f_acm_rndis)) |
164 | ret = PTR_ERR(f_acm_rndis); | 164 | return PTR_ERR(f_acm_rndis); |
165 | goto err_func_acm; | ||
166 | } | ||
167 | 165 | ||
168 | ret = usb_add_function(c, f_acm_rndis); | 166 | ret = usb_add_function(c, f_acm_rndis); |
169 | if (ret) | 167 | if (ret) |
@@ -178,7 +176,6 @@ err_fsg: | |||
178 | usb_remove_function(c, f_acm_rndis); | 176 | usb_remove_function(c, f_acm_rndis); |
179 | err_conf: | 177 | err_conf: |
180 | usb_put_function(f_acm_rndis); | 178 | usb_put_function(f_acm_rndis); |
181 | err_func_acm: | ||
182 | return ret; | 179 | return ret; |
183 | } | 180 | } |
184 | 181 | ||
@@ -226,7 +223,7 @@ static __init int cdc_do_config(struct usb_configuration *c) | |||
226 | /* implicit port_num is zero */ | 223 | /* implicit port_num is zero */ |
227 | f_acm_multi = usb_get_function(fi_acm); | 224 | f_acm_multi = usb_get_function(fi_acm); |
228 | if (IS_ERR(f_acm_multi)) | 225 | if (IS_ERR(f_acm_multi)) |
229 | goto err_func_acm; | 226 | return PTR_ERR(f_acm_multi); |
230 | 227 | ||
231 | ret = usb_add_function(c, f_acm_multi); | 228 | ret = usb_add_function(c, f_acm_multi); |
232 | if (ret) | 229 | if (ret) |
@@ -241,7 +238,6 @@ err_fsg: | |||
241 | usb_remove_function(c, f_acm_multi); | 238 | usb_remove_function(c, f_acm_multi); |
242 | err_conf: | 239 | err_conf: |
243 | usb_put_function(f_acm_multi); | 240 | usb_put_function(f_acm_multi); |
244 | err_func_acm: | ||
245 | return ret; | 241 | return ret; |
246 | } | 242 | } |
247 | 243 | ||