diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2016-02-22 17:22:55 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2016-05-13 08:01:41 -0400 |
commit | 6ecffafe242ec6d2789631499452c54177f0bb4c (patch) | |
tree | 67036428f7a0cd62c9c8a0470dd3e58996f401a9 /arch/mips/cavium-octeon/setup.c | |
parent | 490f7548cfce36b63ec517a8ff7382287db86c29 (diff) |
MIPS: Octeon: board_type_to_string: return NULL for unsupported board
Return NULL for unsupported board.
Signed-off-by: Aaro 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: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/cavium-octeon/setup.c')
-rw-r--r-- | arch/mips/cavium-octeon/setup.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c index 8ffc1f108239..4759494c3ff4 100644 --- a/arch/mips/cavium-octeon/setup.c +++ b/arch/mips/cavium-octeon/setup.c | |||
@@ -466,9 +466,14 @@ static char __read_mostly octeon_system_type[80]; | |||
466 | 466 | ||
467 | static int __init init_octeon_system_type(void) | 467 | static int __init init_octeon_system_type(void) |
468 | { | 468 | { |
469 | char const *board_type; | ||
470 | |||
471 | board_type = cvmx_board_type_to_string(octeon_bootinfo->board_type); | ||
472 | if (board_type == NULL) | ||
473 | board_type = "Unsupported Board"; | ||
474 | |||
469 | snprintf(octeon_system_type, sizeof(octeon_system_type), "%s (%s)", | 475 | snprintf(octeon_system_type, sizeof(octeon_system_type), "%s (%s)", |
470 | cvmx_board_type_to_string(octeon_bootinfo->board_type), | 476 | board_type, octeon_model_get_string(read_c0_prid())); |
471 | octeon_model_get_string(read_c0_prid())); | ||
472 | 477 | ||
473 | return 0; | 478 | return 0; |
474 | } | 479 | } |