(CR):[factory]:[kane]:kernel:modify usb serialno
authorhq_guohongtao5_tmp <guohongtao5@huaqin.com>
Mon, 19 Nov 2018 09:36:17 +0000 (17:36 +0800)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:29:56 +0000 (17:29 +0800)
modify usb serialno

Change-Id: I0b7aa5aabff98b82d27ca0711e8f31620701b72e
Signed-off-by: hq_guohongtao5_tmp <guohongtao5@huaqin.com>
drivers/usb/gadget/configfs.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index a31af00..0a66cea
@@ -166,27 +166,6 @@ static int usb_string_copy(const char *s, char **s_copy)
        return 0;
 }
 
-static int set_alt_serialnumber(struct gadget_strings *gs)
-{
-       char *str;
-       int ret = -ENOMEM;
-
-       str = kmalloc(CHIPID_SIZE + 1, GFP_KERNEL);
-       if (!str) {
-               pr_err("%s: failed to alloc for string\n", __func__);
-               return ret;
-       }
-
-       snprintf(str, CHIPID_SIZE + 1, "%016lx", (long)exynos_soc_info.unique_id);
-       if (usb_string_copy(str, &gs->serialnumber))
-               pr_err("%s: failed to copy alternative string\n", __func__);
-       else
-               ret = 0;
-
-       kfree(str);
-       return ret;
-}
-
 #define GI_DEVICE_DESC_SIMPLE_R_u8(__name)     \
 static ssize_t gadget_dev_desc_##__name##_show(struct config_item *item, \
                        char *page)     \
@@ -1356,9 +1335,6 @@ static int configfs_composite_bind(struct usb_gadget *gadget,
                        gs->strings[USB_GADGET_MANUFACTURER_IDX].s =
                                gs->manufacturer;
                        gs->strings[USB_GADGET_PRODUCT_IDX].s = gs->product;
-                       if (gs->serialnumber && !set_alt_serialnumber(gs))
-                               pr_info("usb: serial number: %s\n",
-                                               gs->serialnumber);
                        gs->strings[USB_GADGET_SERIAL_IDX].s = gs->serialnumber;
                        i++;
                }