#include <linux/configfs.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/device.h>
#include <linux/nls.h>
#include <linux/usb/composite.h>
#include <linux/usb/gadget_configfs.h>
#include "configfs.h"
#include "u_f.h"
#include "u_os_desc.h"
int check_user_usb_string(const char *name,
struct usb_gadget_strings *stringtab_dev)
{
unsigned primary_lang;
unsigned sub_lang;
u16 num;
int ret;
ret = kstrtou16(name, 0, &num);
if (ret)
return ret;
primary_lang = num & 0x3ff;
sub_lang = num >> 10;
/* simple sanity check for valid langid */
switch (primary_lang) {
case