Commit 8abc6fa1 authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Felipe Balbi

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: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 3b45b2a2
...@@ -160,10 +160,8 @@ static __init int rndis_do_config(struct usb_configuration *c) ...@@ -160,10 +160,8 @@ static __init int rndis_do_config(struct usb_configuration *c)
return ret; return ret;
f_acm_rndis = usb_get_function(fi_acm); f_acm_rndis = usb_get_function(fi_acm);
if (IS_ERR(f_acm_rndis)) { if (IS_ERR(f_acm_rndis))
ret = PTR_ERR(f_acm_rndis); return PTR_ERR(f_acm_rndis);
goto err_func_acm;
}
ret = usb_add_function(c, f_acm_rndis); ret = usb_add_function(c, f_acm_rndis);
if (ret) if (ret)
...@@ -178,7 +176,6 @@ static __init int rndis_do_config(struct usb_configuration *c) ...@@ -178,7 +176,6 @@ static __init int rndis_do_config(struct usb_configuration *c)
usb_remove_function(c, f_acm_rndis); usb_remove_function(c, f_acm_rndis);
err_conf: err_conf:
usb_put_function(f_acm_rndis); usb_put_function(f_acm_rndis);
err_func_acm:
return ret; return ret;
} }
...@@ -226,7 +223,7 @@ static __init int cdc_do_config(struct usb_configuration *c) ...@@ -226,7 +223,7 @@ static __init int cdc_do_config(struct usb_configuration *c)
/* implicit port_num is zero */ /* implicit port_num is zero */
f_acm_multi = usb_get_function(fi_acm); f_acm_multi = usb_get_function(fi_acm);
if (IS_ERR(f_acm_multi)) if (IS_ERR(f_acm_multi))
goto err_func_acm; return PTR_ERR(f_acm_multi);
ret = usb_add_function(c, f_acm_multi); ret = usb_add_function(c, f_acm_multi);
if (ret) if (ret)
...@@ -241,7 +238,6 @@ static __init int cdc_do_config(struct usb_configuration *c) ...@@ -241,7 +238,6 @@ static __init int cdc_do_config(struct usb_configuration *c)
usb_remove_function(c, f_acm_multi); usb_remove_function(c, f_acm_multi);
err_conf: err_conf:
usb_put_function(f_acm_multi); usb_put_function(f_acm_multi);
err_func_acm:
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment