Remove unused usb_client 03/229103/1 accepted/tizen/unified/20200406.133218 submit/tizen/20200402.112144
authorINSUN PYO <insun.pyo@samsung.com>
Sun, 29 Mar 2020 23:45:11 +0000 (08:45 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Sun, 29 Mar 2020 23:47:27 +0000 (08:47 +0900)
Change-Id: If2d574da915233d2849017892d64a7ea75191970

hw/usb_cfs_client_common.c
hw/usb_client_common.c

index e9d4135..fb599df 100644 (file)
@@ -94,8 +94,7 @@ static struct usb_function *cfs_find_usb_function(usbg_function *function)
        return find_usb_function_by_name_instance(name, instance);
 }
 
-static bool cfs_is_function_supported(struct usb_client *usb,
-                                        struct usb_function *func)
+static bool cfs_is_function_supported(struct usb_function *func)
 {
        bool res;
        int ret;
@@ -111,7 +110,7 @@ static bool cfs_is_function_supported(struct usb_client *usb,
        return res;
 }
 
-static bool cfs_is_gadget_supported(struct usb_client *usb, struct usb_gadget *gadget)
+static bool cfs_is_gadget_supported(struct usb_gadget *gadget)
 {
        int i, j;
 
@@ -132,7 +131,7 @@ static bool cfs_is_gadget_supported(struct usb_client *usb, struct usb_gadget *g
                        return false;
 
                for (i = 0; config->funcs[i]; ++i)
-                       if (!cfs_is_function_supported(usb, config->funcs[i]))
+                       if (!cfs_is_function_supported(config->funcs[i]))
                                return false;
        }
 
@@ -456,9 +455,12 @@ static int cfs_reconfigure_gadget(struct usb_client *usb, struct usb_gadget *gad
        int ret;
        struct cfs_client *cfs_client;
 
-       if (!usb || !gadget || !cfs_is_gadget_supported(usb, gadget))
+       if (!usb || !gadget)
                return -EINVAL;
 
+       if (!cfs_is_gadget_supported(gadget))
+               return -ENOTSUP;
+
        cfs_client = container_of(usb, struct cfs_client, client);
 
        ret = cfs_set_gadget_attrs(cfs_client, &gadget->attrs);
index 3020cda..709d7c0 100644 (file)
@@ -59,8 +59,7 @@
 #define EXPORT __attribute__ ((visibility("default")))
 #endif
 
-static bool legacy_is_function_supported(struct usb_client *usb,
-                                        struct usb_function *func)
+static bool legacy_is_function_supported(struct usb_function *func)
 {
        /*
         * TODO
@@ -74,8 +73,7 @@ static bool legacy_is_function_supported(struct usb_client *usb,
                return false;
 }
 
-static bool legacy_is_gadget_supported(struct usb_client *usb,
-                                      struct usb_gadget *gadget)
+static bool legacy_is_gadget_supported(struct usb_gadget *gadget)
 {
        int i, j;
 
@@ -96,7 +94,7 @@ static bool legacy_is_gadget_supported(struct usb_client *usb,
                        return false;
 
                for (i = 0; config->funcs[i]; ++i)
-                       if (!legacy_is_function_supported(usb, config->funcs[i]))
+                       if (!legacy_is_function_supported(config->funcs[i]))
                                return false;
        }
 
@@ -206,14 +204,16 @@ empty_config:
        return sys_set_str(cpath, buf);
 }
 
-static int legacy_reconfigure_gadget(struct usb_client *usb,
-                                    struct usb_gadget *gadget)
+static int legacy_reconfigure_gadget(struct usb_client *usb, struct usb_gadget *gadget)
 {
        int ret;
 
-       if (!usb || !gadget || !legacy_is_gadget_supported(usb, gadget))
+       if (!usb || !gadget)
                return -EINVAL;
 
+       if (!legacy_is_gadget_supported(gadget))
+               return -ENOTSUP;
+
        ret = legacy_set_gadget_attrs(&gadget->attrs);
        if (ret)
                return ret;
@@ -227,8 +227,10 @@ static int legacy_reconfigure_gadget(struct usb_client *usb,
                return ret;
 
        ret = legacy_set_gadget_config(LEGACY_CONFIG_2_PATH, gadget->configs[1]);
+       if (ret)
+               return ret;
 
-       return ret;
+       return 0;
 }
 
 static void legacy_start_stop_service_and_handler(bool start)