From: JiebingLi <jiebing.li@xxxxxxxxx> This patch makes the composite gadget more flexible in case that any of the functions fails to be bound. Signed-off-by: JiebingLi <jiebing.li@xxxxxxxxx> --- drivers/usb/gadget/nokia.c | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/nokia.c b/drivers/usb/gadget/nokia.c index f1c2647..d99a67c 100644 --- a/drivers/usb/gadget/nokia.c +++ b/drivers/usb/gadget/nokia.c @@ -117,35 +117,48 @@ static u8 hostaddr[ETH_ALEN]; static int __init nokia_bind_config(struct usb_configuration *c) { - int status = 0; + int status = 0; + int ret = -ENODEV; status = phonet_bind_config(c); if (status) printk(KERN_DEBUG "could not bind phonet config\n"); + else + ret = 0; status = obex_bind_config(c, 0); if (status) printk(KERN_DEBUG "could not bind obex config %d\n", 0); + else + ret = 0; status = obex_bind_config(c, 1); if (status) printk(KERN_DEBUG "could not bind obex config %d\n", 0); + else + ret = 0; status = acm_bind_config(c, 2); if (status) printk(KERN_DEBUG "could not bind acm config\n"); + else + ret = 0; if (use_eem) { status = eem_bind_config(c); if (status) printk(KERN_DEBUG "could not bind eem config\n"); + else + ret = 0; } else { status = ecm_bind_config(c, hostaddr); if (status) printk(KERN_DEBUG "could not bind ecm config\n"); + else + ret = 0; } - return status; + return ret; } static struct usb_configuration nokia_config_500ma_driver = { -- 1.6.0.3 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html