提交 6ecffafe 编写于 作者: A Aaro Koskinen 提交者: Ralf Baechle

MIPS: Octeon: board_type_to_string: return NULL for unsupported board

Return NULL for unsupported board.
Signed-off-by: NAaro Koskinen <aaro.koskinen@iki.fi>
Cc: David Daney <ddaney.cavm@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/12581/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 490f7548
...@@ -466,9 +466,14 @@ static char __read_mostly octeon_system_type[80]; ...@@ -466,9 +466,14 @@ static char __read_mostly octeon_system_type[80];
static int __init init_octeon_system_type(void) static int __init init_octeon_system_type(void)
{ {
char const *board_type;
board_type = cvmx_board_type_to_string(octeon_bootinfo->board_type);
if (board_type == NULL)
board_type = "Unsupported Board";
snprintf(octeon_system_type, sizeof(octeon_system_type), "%s (%s)", snprintf(octeon_system_type, sizeof(octeon_system_type), "%s (%s)",
cvmx_board_type_to_string(octeon_bootinfo->board_type), board_type, octeon_model_get_string(read_c0_prid()));
octeon_model_get_string(read_c0_prid()));
return 0; return 0;
} }
......
...@@ -400,7 +400,7 @@ static inline const char *cvmx_board_type_to_string(enum ...@@ -400,7 +400,7 @@ static inline const char *cvmx_board_type_to_string(enum
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KONTRON_S1901) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KONTRON_S1901)
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX)
} }
return "Unsupported Board"; return NULL;
} }
#define ENUM_CHIP_TYPE_CASE(x) \ #define ENUM_CHIP_TYPE_CASE(x) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册