[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1625908395-5498-3-git-send-email-wcheng@codeaurora.org>
Date: Sat, 10 Jul 2021 02:13:11 -0700
From: Wesley Cheng <wcheng@...eaurora.org>
To: balbi@...nel.org, gregkh@...uxfoundation.org, agross@...nel.org,
bjorn.andersson@...aro.org, robh+dt@...nel.org,
frowand.list@...il.com
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
jackp@...eaurora.org, Wesley Cheng <wcheng@...eaurora.org>
Subject: [PATCH v14 2/6] usb: gadget: configfs: Check USB configuration before adding
Ensure that the USB gadget is able to support the configuration being
added based on the number of endpoints required from all interfaces. This
is for accounting for any bandwidth or space limitations.
Signed-off-by: Wesley Cheng <wcheng@...eaurora.org>
---
drivers/usb/gadget/configfs.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index 15a607c..f4c7c82 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -1404,6 +1404,10 @@ static int configfs_composite_bind(struct usb_gadget *gadget,
goto err_purge_funcs;
}
}
+ ret = usb_gadget_check_config(cdev->gadget);
+ if (ret)
+ goto err_purge_funcs;
+
usb_ep_autoconfig_reset(cdev->gadget);
}
if (cdev->use_os_string) {
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Powered by blists - more mailing lists