Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752075AbbFBURM (ORCPT ); Tue, 2 Jun 2015 16:17:12 -0400 Received: from mail.windriver.com ([147.11.1.11]:35533 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751444AbbFBUQj (ORCPT ); Tue, 2 Jun 2015 16:16:39 -0400 From: Paul Gortmaker To: CC: Paul Gortmaker , Ralf Baechle , Subject: [PATCH 3/4] mips: make loongsoon serial driver explicitly modular Date: Tue, 2 Jun 2015 16:16:07 -0400 Message-ID: <1433276168-21550-4-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.2.1 In-Reply-To: <1433276168-21550-1-git-send-email-paul.gortmaker@windriver.com> References: <1433276168-21550-1-git-send-email-paul.gortmaker@windriver.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2034 Lines: 55 The file looks as if it is non-modular, but it piggy-backs off CONFIG_SERIAL_8250 which is tristate. If set to "=m" we will get this after the init/module header cleanup: arch/mips/loongson/common/serial.c:76:1: error: data definition has no type or storage class [-Werror] arch/mips/loongson/common/serial.c:76:1: error: type defaults to 'int' in declaration of 'device_initcall' [-Werror=implicit-int] arch/mips/loongson/common/serial.c:76:1: error: parameter names (without types) in function declaration [-Werror] arch/mips/loongson/common/serial.c:58:19: error: 'serial_init' defined but not used [-Werror=unused-function] cc1: all warnings being treated as errors make[3]: *** [arch/mips/loongson/common/serial.o] Error 1 Make it clearly modular, and add a module_exit function, so that we avoid the above breakage. Reported-by: kbuild test robot Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Signed-off-by: Paul Gortmaker --- arch/mips/loongson/common/serial.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/mips/loongson/common/serial.c b/arch/mips/loongson/common/serial.c index c23fa1373729..ffefc1cb2612 100644 --- a/arch/mips/loongson/common/serial.c +++ b/arch/mips/loongson/common/serial.c @@ -11,7 +11,7 @@ */ #include -#include +#include #include #include @@ -108,5 +108,10 @@ static int __init serial_init(void) return platform_device_register(&uart8250_device); } +module_init(serial_init); -device_initcall(serial_init); +static void __init serial_exit(void) +{ + platform_device_unregister(&uart8250_device); +} +module_exit(serial_exit); -- 2.2.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/