Return NULL for unsupported board. Signed-off-by: Aaro Koskinen <aaro.koskinen@xxxxxx> --- arch/mips/cavium-octeon/setup.c | 9 +++++++-- arch/mips/include/asm/octeon/cvmx-bootinfo.h | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c index cd7101f..5be2072 100644 --- a/arch/mips/cavium-octeon/setup.c +++ b/arch/mips/cavium-octeon/setup.c @@ -468,9 +468,14 @@ static char __read_mostly octeon_system_type[80]; 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)", - cvmx_board_type_to_string(octeon_bootinfo->board_type), - octeon_model_get_string(read_c0_prid())); + board_type, octeon_model_get_string(read_c0_prid())); return 0; } diff --git a/arch/mips/include/asm/octeon/cvmx-bootinfo.h b/arch/mips/include/asm/octeon/cvmx-bootinfo.h index d92cf59..a00f903 100644 --- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h +++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h @@ -388,7 +388,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_CUST_PRIVATE_MAX) } - return "Unsupported Board"; + return NULL; } #define ENUM_CHIP_TYPE_CASE(x) \ -- 2.4.0