Do not stop services while enabling usb gadget 86/221086/1
authorHyotaek Shim <hyotaek.shim@samsung.com>
Fri, 27 Dec 2019 04:32:50 +0000 (13:32 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Fri, 27 Dec 2019 04:32:50 +0000 (13:32 +0900)
Change-Id: I86557c424d400c27260bb427a409940c022a8f91
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
hw/usb_client_common.c

index 8a97abe..abfa6b2 100755 (executable)
@@ -561,24 +561,11 @@ static int legacy_enable(struct usb_client *usb)
 
                fws = container_of(gadget->funcs[i],
                                   struct usb_function_with_service, func);
-               ret = systemd_start_unit_wait_started(fws->service, ".service", -1);
-               if (ret < 0)
-                       goto stop_services;
+               systemd_start_unit_wait_started(fws->service, ".service", -1);
        }
 
        legacy_free_gadget(gadget);
        return 0;
-stop_services:
-       while (--i >= 0) {
-               if (gadget->funcs[i]->function_group !=
-                   USB_FUNCTION_GROUP_WITH_SERVICE)
-                       continue;
-
-               fws = container_of(gadget->funcs[i],
-                                  struct usb_function_with_service, func);
-               systemd_stop_unit_wait_stopped(fws->service, ".service", -1);
-       }
-       legacy_free_gadget(gadget);
 
 disable_gadget:
        sys_set_str(LEGACY_ENABLE_PATH, LEGACY_DISABLE);