usb: gadget: slp: fix to use arm system_serial if no dmi serial 02/125502/7
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 18 Apr 2017 01:15:12 +0000 (10:15 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Fri, 23 Jun 2017 04:59:11 +0000 (04:59 +0000)
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 f61ea943961e99053a523d22453db246a76d3aa6..d263da9d3ff9aeedcfd3c318a502449ebbc86e00 100644 (file)
 #include <linux/usb/composite.h>
 #include <linux/usb/gadget.h>
 
+#ifdef CONFIG_ARM
+#include <asm/system_info.h>
+#endif
+
 #include "gadget_chips.h"
 
 #include "../function/f_sdb.c"
@@ -1203,7 +1207,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, "%08x%08x",
+                        system_serial_high, system_serial_low);
+#else
                snprintf(serial_string, 18, "%s", "01234TEST");
+#endif
 
        id = usb_string_id(cdev);
        if (id < 0)