]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: mach/prom: add identifiers to soc_info structure 23173/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Fri, 1 May 2026 08:02:16 +0000 (10:02 +0200)
committerRobert Marko <robimarko@gmail.com>
Thu, 7 May 2026 16:19:56 +0000 (18:19 +0200)
SoC name and system type identifiers are currently separated from
the soc_info structure. This gives no benefit. Relocate that info
into the structure where it belongs.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/23173
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.18/arch/mips/include/asm/mach-rtl-otto/mach-rtl-otto.h
target/linux/realtek/files-6.18/arch/mips/rtl-otto/prom.c

index 64b1cbe1e3422202f98f8b780e347823ef6cefd7..9079ff24f67b0aa52ffd01810deb36c8258c1afe 100644 (file)
@@ -51,7 +51,8 @@
 #define RTL9607_CPU_PORT               9
 
 struct rtl83xx_soc_info {
-       unsigned char *name;
+       char name[16];
+       char system_type[64];
        unsigned int id;
        unsigned int family;
        unsigned int revision;
index 7b26426097710e3911554fb1c763ee74e9b1b7c2..7e2cf729e2b3ffe3e83be8125c927fe8c856e2a4 100644 (file)
@@ -43,9 +43,6 @@ EXPORT_SYMBOL(soc_info);
 
 const void *fdt;
 
-static char rtl_soc_name[16];
-static char rtl_system_type[48];
-
 #ifdef CONFIG_MIPS_MT_SMP
 
 extern const struct plat_smp_ops vsmp_smp_ops;
@@ -157,7 +154,7 @@ void __init device_tree_init(void)
 
 const char *get_system_type(void)
 {
-       return rtl_system_type;
+       return soc_info.system_type;
 }
 
 static void __init rtl838x_read_details(u32 model)
@@ -298,10 +295,8 @@ static void __init parse_model(u32 model)
        if (val > 0 && val <= 26)
                suffix = 'A' + (val - 1);
 
-       snprintf(rtl_soc_name, sizeof(rtl_soc_name), "RTL%04X%c",
+       snprintf(soc_info.name, sizeof(soc_info.name), "RTL%04X%c",
                 soc_info.id, suffix);
-
-       soc_info.name = rtl_soc_name;
 }
 
 static void __init set_system_type(void)
@@ -319,7 +314,7 @@ static void __init set_system_type(void)
        if (soc_info.subtype)
                snprintf(subtype, sizeof(subtype), " subtype %02X", soc_info.subtype);
 
-       snprintf(rtl_system_type, sizeof(rtl_system_type),
+       snprintf(soc_info.system_type, sizeof(soc_info.system_type),
                 "Realtek %s%s%s rev %c (%04X)",
                 soc_info.name, es, subtype, revision, soc_info.cpu);
 }