summaryrefslogtreecommitdiffstats
path: root/include/linux/usb/gadget.h
diff options
context:
space:
mode:
authorTao Ren <rentao.bupt@gmail.com>2020-03-15 12:16:28 -0700
committerFelipe Balbi <balbi@kernel.org>2020-05-05 10:58:51 +0300
commit17309a6a43561bd7f4d4b51d7987225eb2b13d05 (patch)
treeac43215c4142fe3e783955d1af712f340fddf4c0 /include/linux/usb/gadget.h
parent5cc0710f23689455d40d590ebbcbcd21b0d84c77 (diff)
downloadlinux-stable-17309a6a43561bd7f4d4b51d7987225eb2b13d05.tar.gz
linux-stable-17309a6a43561bd7f4d4b51d7987225eb2b13d05.tar.bz2
linux-stable-17309a6a43561bd7f4d4b51d7987225eb2b13d05.zip
usb: gadget: add "usb_validate_langid" function
The USB LANGID validation code in "check_user_usb_string" function is moved to "usb_validate_langid" function which can be used by other usb gadget drivers. Signed-off-by: Tao Ren <rentao.bupt@gmail.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'include/linux/usb/gadget.h')
-rw-r--r--include/linux/usb/gadget.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 9411c08a5c7e..e959c09a97c9 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -773,6 +773,9 @@ struct usb_gadget_string_container {
/* put descriptor for string with that id into buf (buflen >= 256) */
int usb_gadget_get_string(const struct usb_gadget_strings *table, int id, u8 *buf);
+/* check if the given language identifier is valid */
+bool usb_validate_langid(u16 langid);
+
/*-------------------------------------------------------------------------*/
/* utility to simplify managing config descriptors */