usb: gadget: slp: fix to use arm system_serial if no dmi serial
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 18 Apr 2017 01:15:12 +0000 (10:15 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 29 Jan 2019 02:25:36 +0000 (11:25 +0900)
From ARM system, system_serial is identical serial number. So, this
patch fixes to use arm system_serial as serial of lagacy slp usb
gadget instead of fixed serial if there is no dmi serial value.

Change-Id: Ie28c6c3d2afc54fc1ea54d3eb67100d3ed27165d
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/usb/gadget/legacy/slp.c

index cc76cee..1eeca11 100644 (file)
 #include <linux/usb/composite.h>
 #include <linux/usb/gadget.h>
 
+#ifdef CONFIG_ARM
+#include <asm/system_info.h>
+#endif
+
 #include "../function/f_sdb.c"
 #include "../function/f_mtp.c"
 #include "../function/f_acm.c"
@@ -1200,7 +1204,12 @@ static int slp_multi_bind(struct usb_composite_dev *cdev)
        if (serial)
                snprintf(serial_string, 18, "%s", serial);
        else
+#ifdef CONFIG_ARM
+               snprintf(serial_string, 18, "%s",
+                        system_serial);
+#else
                snprintf(serial_string, 18, "%s", "01234TEST");
+#endif
 
        id = usb_string_id(cdev);
        if (id < 0)