[PATCH v2 2/2] MIPS: Fix build errors under CONFIG_HAVE_STD_PC_SERIAL_PORT

From: Tiezhu Yang
Date: Thu May 14 2020 - 23:23:18 EST


When CONFIG_HAVE_STD_PC_SERIAL_PORT is set, include linux/module.h to fix
the following build errors:

CC arch/mips/kernel/8250-platform.o
arch/mips/kernel/8250-platform.c:42:1: error: data definition has no type or storage class [-Werror]
module_init(uart8250_init);
^
arch/mips/kernel/8250-platform.c:42:1: error: type defaults to âintâ in declaration of âmodule_initâ [-Werror=implicit-int]
arch/mips/kernel/8250-platform.c:42:1: error: parameter names (without types) in function declaration [-Werror]
arch/mips/kernel/8250-platform.c:44:15: error: expected declaration specifiers or â...â before string constant
MODULE_AUTHOR("Ralf Baechle <ralf@xxxxxxxxxxxxxx>");
^
arch/mips/kernel/8250-platform.c:45:16: error: expected declaration specifiers or â...â before string constant
MODULE_LICENSE("GPL");
^
arch/mips/kernel/8250-platform.c:46:20: error: expected declaration specifiers or â...â before string constant
MODULE_DESCRIPTION("Generic 8250 UART probe driver");
^
arch/mips/kernel/8250-platform.c:37:81: error: âuart8250_initâ defined but not used [-Werror=unused-function]
static int __init uart8250_init(void)
^
cc1: all warnings being treated as errors
scripts/Makefile.build:267: recipe for target 'arch/mips/kernel/8250-platform.o' failed
make[2]: *** [arch/mips/kernel/8250-platform.o] Error 1

Fixes: 848484e2c412 ("mips: remove needless include of module.h from core kernel files.")
Signed-off-by: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
---

v2:
- No changes

arch/mips/kernel/8250-platform.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/mips/kernel/8250-platform.c b/arch/mips/kernel/8250-platform.c
index 5c6b2ab..cbf3fe2 100644
--- a/arch/mips/kernel/8250-platform.c
+++ b/arch/mips/kernel/8250-platform.c
@@ -5,6 +5,7 @@
*
* Copyright (C) 2007 Ralf Baechle (ralf@xxxxxxxxxxxxxx)
*/
+#include <linux/module.h>
#include <linux/init.h>
#include <linux/serial_8250.h>

--
2.1.0