usb: gadget: remove variable ret and remove unnecessary if statement
authorColin Ian King <colin.king@canonical.com>
Thu, 8 Sep 2016 20:09:30 +0000 (21:09 +0100)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Fri, 9 Sep 2016 10:38:37 +0000 (13:38 +0300)
the if statement in lb_modinit is unnecessary so we can totally
remove the variable ret and just return the return value from
the call to usb_function_register.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/function/f_loopback.c

index ddb8c89..e700938 100644 (file)
@@ -591,13 +591,9 @@ DECLARE_USB_FUNCTION(Loopback, loopback_alloc_instance, loopback_alloc);
 
 int __init lb_modinit(void)
 {
-       int ret;
-
-       ret = usb_function_register(&Loopbackusb_func);
-       if (ret)
-               return ret;
-       return ret;
+       return usb_function_register(&Loopbackusb_func);
 }
+
 void __exit lb_modexit(void)
 {
        usb_function_unregister(&Loopbackusb_func);