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>
This commit is contained in:
Родитель
3b45b2a2ad
Коммит
8abc6fa163
|
@ -160,10 +160,8 @@ static __init int rndis_do_config(struct usb_configuration *c)
|
|||
return ret;
|
||||
|
||||
f_acm_rndis = usb_get_function(fi_acm);
|
||||
if (IS_ERR(f_acm_rndis)) {
|
||||
ret = PTR_ERR(f_acm_rndis);
|
||||
goto err_func_acm;
|
||||
}
|
||||
if (IS_ERR(f_acm_rndis))
|
||||
return PTR_ERR(f_acm_rndis);
|
||||
|
||||
ret = usb_add_function(c, f_acm_rndis);
|
||||
if (ret)
|
||||
|
@ -178,7 +176,6 @@ err_fsg:
|
|||
usb_remove_function(c, f_acm_rndis);
|
||||
err_conf:
|
||||
usb_put_function(f_acm_rndis);
|
||||
err_func_acm:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -226,7 +223,7 @@ static __init int cdc_do_config(struct usb_configuration *c)
|
|||
/* implicit port_num is zero */
|
||||
f_acm_multi = usb_get_function(fi_acm);
|
||||
if (IS_ERR(f_acm_multi))
|
||||
goto err_func_acm;
|
||||
return PTR_ERR(f_acm_multi);
|
||||
|
||||
ret = usb_add_function(c, f_acm_multi);
|
||||
if (ret)
|
||||
|
@ -241,7 +238,6 @@ err_fsg:
|
|||
usb_remove_function(c, f_acm_multi);
|
||||
err_conf:
|
||||
usb_put_function(f_acm_multi);
|
||||
err_func_acm:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче