ramips: cleanup WZR-AGL300NH board support file
[openwrt.git] / target / linux / ar71xx / patches-2.6.30 / 400-mips-multi-machine-update.patch
index 62903c8..d635879 100644 (file)
@@ -15,7 +15,7 @@
  
  char *mips_machine_name = "Unknown";
  
-@@ -55,20 +56,64 @@ void __init mips_machine_set_name(char *
+@@ -55,20 +56,65 @@ void __init mips_machine_set_name(char *
        }
  }
  
 +
 +      list_for_each(this, &mips_machines) {
 +              mach = list_entry(this, struct mips_machine, list);
-+              if (strncmp(mach->mach_id, mips_machid,
-+                          strlen(mips_machid)) == 0
-+              ) {
++              if (mach->mach_id == NULL)
++                      continue;
++
++              if (strcmp(mach->mach_id, mips_machid) == 0) {
 +                      mips_machtype = mach->mach_type;
 +                      return 0;
 +              }
 +      list_for_each(this, &mips_machines) {
 +              mach = list_entry(this, struct mips_machine, list);
 +              printk(KERN_WARNING "%32s %s\n",
-+                     mach->mach_id, mach->mach_name);
++                     mach->mach_id ? mach->mach_id : "", mach->mach_name);
 +      }
 +
 +      return 0;
 +}
 +
 +core_initcall(mips_machtype_init);
---- a/include/asm-mips/mips_machine.h
-+++ b/include/asm-mips/mips_machine.h
-@@ -13,24 +13,32 @@
+--- a/arch/mips/include/asm/mips_machine.h
++++ b/arch/mips/include/asm/mips_machine.h
+@@ -13,25 +13,33 @@
  #include <linux/init.h>
  #include <linux/list.h>
  
  
 -#define MIPS_MACHINE(_type, _name, _setup)                    \
 -static char machine_name_##_type[] __initdata = _name;                \
--static struct mips_machine machine_##_type __initdata =               \
 +#define MIPS_MACHINE(_type, _id, _name, _setup)               \
-+static char machine_name_##_type[] __initconst                        \
++static const char machine_name_##_type[] __initconst          \
 +                      __aligned(1) = _name;                   \
-+static char machine_id_##_type[] __initconst                  \
++static const char machine_id_##_type[] __initconst            \
 +                      __aligned(1) = _id;                     \
-+static struct mips_machine machine_##_type __initconst =      \
+ static struct mips_machine machine_##_type __initdata =               \
  {                                                             \
        .mach_type      = _type,                                \
-+      .mach_id        = machine_id_##_type,                   \
-       .mach_name      = machine_name_##_type,                 \
+-      .mach_name      = machine_name_##_type,                 \
++      .mach_id        = (char *) machine_id_##_type,          \
++      .mach_name      = (char *) machine_name_##_type,        \
        .mach_setup     = _setup,                               \
  };                                                            \
+                                                               \
+@@ -44,4 +52,3 @@ static int __init register_machine_##_ty
+ pure_initcall(register_machine_##_type)
+ #endif /* __ASM_MIPS_MACHINE_H */
+-
This page took 0.0321 seconds and 4 git commands to generate.