Hello. On 01-11-2010 14:22, Li, Jiebing wrote:
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;
Why initialize ir at all, if the code assign it immediately after?
+ int ret = -ENODEV;
Better initialize it to 0, and then assign the fitting error codes on error.
status = phonet_bind_config(c); if (status) printk(KERN_DEBUG "could not bind phonet config\n"); + else + ret = 0;
WBR, Sergei -- 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