From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <fengguang.wu@intel.com>
Cc: <linux-serial@vger.kernel.org>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
Ralf Baechle <ralf@linux-mips.org>, <linux-mips@linux-mips.org>
Subject: [PATCH] mips: make loongsoon serial driver explicitly modular
Date: Wed, 22 Jan 2014 10:17:51 -0500 [thread overview]
Message-ID: <1390403871-16809-1-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <52df9ab1.ahF1zl0PTutzrviC%fengguang.wu@intel.com>
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 <fengguang.wu@intel.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
[patch added to init cleanup series:
http://git.kernel.org/cgit/linux/kernel/git/paulg/init.git/ ]
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 5f2b78a..4d0922f 100644
--- a/arch/mips/loongson/common/serial.c
+++ b/arch/mips/loongson/common/serial.c
@@ -11,7 +11,7 @@
*/
#include <linux/io.h>
-#include <linux/init.h>
+#include <linux/module.h>
#include <linux/serial_8250.h>
#include <asm/bootinfo.h>
@@ -72,5 +72,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);
--
1.8.5.1
WARNING: multiple messages have this Message-ID (diff)
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: fengguang.wu@intel.com
Cc: linux-serial@vger.kernel.org,
Paul Gortmaker <paul.gortmaker@windriver.com>,
Ralf Baechle <ralf@linux-mips.org>,
linux-mips@linux-mips.org
Subject: [PATCH] mips: make loongsoon serial driver explicitly modular
Date: Wed, 22 Jan 2014 10:17:51 -0500 [thread overview]
Message-ID: <1390403871-16809-1-git-send-email-paul.gortmaker@windriver.com> (raw)
Message-ID: <20140122151751.wr7hjWoZ-CUuI_4U87q2DmNApe9KwMBiAZEg0D-ytXI@z> (raw)
In-Reply-To: <52df9ab1.ahF1zl0PTutzrviC%fengguang.wu@intel.com>
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 <fengguang.wu@intel.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
[patch added to init cleanup series:
http://git.kernel.org/cgit/linux/kernel/git/paulg/init.git/ ]
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 5f2b78a..4d0922f 100644
--- a/arch/mips/loongson/common/serial.c
+++ b/arch/mips/loongson/common/serial.c
@@ -11,7 +11,7 @@
*/
#include <linux/io.h>
-#include <linux/init.h>
+#include <linux/module.h>
#include <linux/serial_8250.h>
#include <asm/bootinfo.h>
@@ -72,5 +72,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);
--
1.8.5.1
next parent reply other threads:[~2014-01-22 15:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <52df9ab1.ahF1zl0PTutzrviC%fengguang.wu@intel.com>
2014-01-22 15:17 ` Paul Gortmaker [this message]
2014-01-22 15:17 ` [PATCH] mips: make loongsoon serial driver explicitly modular Paul Gortmaker
2014-01-22 15:25 ` John Crispin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1390403871-16809-1-git-send-email-paul.gortmaker@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=fengguang.wu@intel.com \
--cc=linux-mips@linux-mips.org \
--cc=linux-serial@vger.kernel.org \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.