lkml.org 
[lkml]   [2020]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 05/13] MIPS: generic: Allow boards to set system type
Date
Check for the (already existing) "system_type" variable in the
get_system_type() function. If non-NULL, return it as the system type.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---

Notes:
v2: Instead of adding a .get_system_type callback to the mips_machine
struct, the boards now simply override the "system_type" variable
when they want to set a custom one.

arch/mips/generic/proc.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/mips/generic/proc.c b/arch/mips/generic/proc.c
index 4c992809cc3f..cce2fde219a3 100644
--- a/arch/mips/generic/proc.c
+++ b/arch/mips/generic/proc.c
@@ -8,11 +8,16 @@

#include <asm/bootinfo.h>

+char *system_type;
+
const char *get_system_type(void)
{
const char *str;
int err;

+ if (system_type)
+ return system_type;
+
err = of_property_read_string(of_root, "model", &str);
if (!err)
return str;
--
2.28.0
\
 
 \ /
  Last update: 2020-08-12 02:16    [W:0.147 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site