diff options
Diffstat (limited to 'hw/usb_cfs_client_common.c')
-rw-r--r-- | hw/usb_cfs_client_common.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/hw/usb_cfs_client_common.c b/hw/usb_cfs_client_common.c index e9d4135..fb599df 100644 --- a/hw/usb_cfs_client_common.c +++ b/hw/usb_cfs_client_common.c @@ -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); |