* [PATCH 0/4] Relocate module code from init.h to module.h
@ 2015-06-02 20:16 Paul Gortmaker
2015-06-02 20:16 ` Paul Gortmaker
2015-06-02 20:16 ` [PATCH 3/4] mips: make loongsoon serial driver explicitly modular Paul Gortmaker
0 siblings, 2 replies; 12+ messages in thread
From: Paul Gortmaker @ 2015-06-02 20:16 UTC (permalink / raw)
To: linux-kernel
Cc: Paul Gortmaker, H. Peter Anvin, Ingo Molnar, Ralf Baechle,
Russell King, Rusty Russell, Thomas Gleixner, linux-arm-kernel,
linux-mips, x86
What started as a removal of no longer required include <linux/init.h>
due to the earlier __cpuinit and __devinit removal led to the observation
that some module specfic support was living in init.h itself, thus
preventing the full removal from introducing compile regressions.
This series of commits includes the final relocation of the modular
init code from <init.h> to <module.h> -- we do this because modular
users will always be users of init functionality, but users of init
functionality are not necessarily always modules. Once done, the
trivial one line removals can be finalized at any time, a bit at a
time, through maintainer trees etc.
In order to do that, a couple of final things that this will uncover
are fixed up here -- things that weren't easily categorized into any
of the other previous series leading up to this final one. The
previous groupings of commits that get us to this final series are:
1: [PATCH 00/11] Delete new __cpuinit users and then delete stubs
https://lkml.kernel.org/r/1430174880-27958-1-git-send-email-paul.gortmaker@windriver.com
2: [PATCH 00/11] Fix implicit includes of <module.h> that will break.
https://lkml.kernel.org/r/1430444867-22342-1-git-send-email-paul.gortmaker@windriver.com>
3: [PATCH 00/15] Replace module_init with device_initcall in non modules
https://lkml.kernel.org/r/1432860493-23831-1-git-send-email-paul.gortmaker@windriver.com
4: [PATCH 00/11] Replace module_init with an alternate initcall in non modules
https://lkml.kernel.org/r/1433120052-18281-1-git-send-email-paul.gortmaker@windriver.com
5: [PATCH 0/7] Introduce builtin_driver and use it for non-modular code
https://lkml.kernel.org/r/1431287385-1526-1-git-send-email-paul.gortmaker@windriver.com>
This group of six is factored out from what was a previously larger series[1]
so that there is a common theme and lower patch count to ease review. Setting
aside the trivial one line include <linux/init.h> removals for later also
greatly reduces the series size and makes all six parts more manageable.
Paul.
[1] http://lkml.kernel.org/r/1390339396-3479-1-git-send-email-paul.gortmaker@windriver.com
---
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@linux-mips.org
Cc: x86@kernel.org
Paul Gortmaker (4):
x86: replace __init_or_module with __init in non-modular vsmp_64.c
arm: fix implicit #include <linux/init.h> in entry asm.
mips: make loongsoon serial driver explicitly modular
module: relocate module_init from init.h to module.h
arch/arm/kernel/entry-armv.S | 2 +
arch/mips/loongson/common/serial.c | 9 +++-
arch/x86/kernel/vsmp_64.c | 2 +-
include/linux/init.h | 78 -----------------------------------
include/linux/module.h | 84 ++++++++++++++++++++++++++++++++++++++
5 files changed, 94 insertions(+), 81 deletions(-)
--
2.2.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 0/4] Relocate module code from init.h to module.h
2015-06-02 20:16 [PATCH 0/4] Relocate module code from init.h to module.h Paul Gortmaker
@ 2015-06-02 20:16 ` Paul Gortmaker
2015-06-02 20:16 ` [PATCH 3/4] mips: make loongsoon serial driver explicitly modular Paul Gortmaker
1 sibling, 0 replies; 12+ messages in thread
From: Paul Gortmaker @ 2015-06-02 20:16 UTC (permalink / raw)
To: linux-kernel
Cc: Paul Gortmaker, H. Peter Anvin, Ingo Molnar, Ralf Baechle,
Russell King, Rusty Russell, Thomas Gleixner, linux-arm-kernel,
linux-mips, x86
What started as a removal of no longer required include <linux/init.h>
due to the earlier __cpuinit and __devinit removal led to the observation
that some module specfic support was living in init.h itself, thus
preventing the full removal from introducing compile regressions.
This series of commits includes the final relocation of the modular
init code from <init.h> to <module.h> -- we do this because modular
users will always be users of init functionality, but users of init
functionality are not necessarily always modules. Once done, the
trivial one line removals can be finalized at any time, a bit at a
time, through maintainer trees etc.
In order to do that, a couple of final things that this will uncover
are fixed up here -- things that weren't easily categorized into any
of the other previous series leading up to this final one. The
previous groupings of commits that get us to this final series are:
1: [PATCH 00/11] Delete new __cpuinit users and then delete stubs
https://lkml.kernel.org/r/1430174880-27958-1-git-send-email-paul.gortmaker@windriver.com
2: [PATCH 00/11] Fix implicit includes of <module.h> that will break.
https://lkml.kernel.org/r/1430444867-22342-1-git-send-email-paul.gortmaker@windriver.com>
3: [PATCH 00/15] Replace module_init with device_initcall in non modules
https://lkml.kernel.org/r/1432860493-23831-1-git-send-email-paul.gortmaker@windriver.com
4: [PATCH 00/11] Replace module_init with an alternate initcall in non modules
https://lkml.kernel.org/r/1433120052-18281-1-git-send-email-paul.gortmaker@windriver.com
5: [PATCH 0/7] Introduce builtin_driver and use it for non-modular code
https://lkml.kernel.org/r/1431287385-1526-1-git-send-email-paul.gortmaker@windriver.com>
This group of six is factored out from what was a previously larger series[1]
so that there is a common theme and lower patch count to ease review. Setting
aside the trivial one line include <linux/init.h> removals for later also
greatly reduces the series size and makes all six parts more manageable.
Paul.
[1] http://lkml.kernel.org/r/1390339396-3479-1-git-send-email-paul.gortmaker@windriver.com
---
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@linux-mips.org
Cc: x86@kernel.org
Paul Gortmaker (4):
x86: replace __init_or_module with __init in non-modular vsmp_64.c
arm: fix implicit #include <linux/init.h> in entry asm.
mips: make loongsoon serial driver explicitly modular
module: relocate module_init from init.h to module.h
arch/arm/kernel/entry-armv.S | 2 +
arch/mips/loongson/common/serial.c | 9 +++-
arch/x86/kernel/vsmp_64.c | 2 +-
include/linux/init.h | 78 -----------------------------------
include/linux/module.h | 84 ++++++++++++++++++++++++++++++++++++++
5 files changed, 94 insertions(+), 81 deletions(-)
--
2.2.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/4] mips: make loongsoon serial driver explicitly modular
2015-06-02 20:16 [PATCH 0/4] Relocate module code from init.h to module.h Paul Gortmaker
2015-06-02 20:16 ` Paul Gortmaker
@ 2015-06-02 20:16 ` Paul Gortmaker
2015-06-02 20:16 ` Paul Gortmaker
` (3 more replies)
1 sibling, 4 replies; 12+ messages in thread
From: Paul Gortmaker @ 2015-06-02 20:16 UTC (permalink / raw)
To: linux-kernel; +Cc: Paul Gortmaker, Ralf Baechle, linux-mips
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>
---
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 <linux/io.h>
-#include <linux/init.h>
+#include <linux/module.h>
#include <linux/serial_8250.h>
#include <asm/bootinfo.h>
@@ -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
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/4] mips: make loongsoon serial driver explicitly modular
2015-06-02 20:16 ` [PATCH 3/4] mips: make loongsoon serial driver explicitly modular Paul Gortmaker
@ 2015-06-02 20:16 ` Paul Gortmaker
2015-06-02 21:47 ` Paul Bolle
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Paul Gortmaker @ 2015-06-02 20:16 UTC (permalink / raw)
To: linux-kernel; +Cc: Paul Gortmaker, Ralf Baechle, linux-mips
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>
---
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 <linux/io.h>
-#include <linux/init.h>
+#include <linux/module.h>
#include <linux/serial_8250.h>
#include <asm/bootinfo.h>
@@ -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
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] mips: make loongsoon serial driver explicitly modular
2015-06-02 20:16 ` [PATCH 3/4] mips: make loongsoon serial driver explicitly modular Paul Gortmaker
2015-06-02 20:16 ` Paul Gortmaker
@ 2015-06-02 21:47 ` Paul Bolle
2015-06-02 22:43 ` Paul Gortmaker
2015-06-03 7:55 ` Ralf Baechle
2015-06-09 7:35 ` Ralf Baechle
3 siblings, 1 reply; 12+ messages in thread
From: Paul Bolle @ 2015-06-02 21:47 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: linux-kernel, Ralf Baechle, linux-mips
On Tue, 2015-06-02 at 16:16 -0400, Paul Gortmaker wrote:
> +static void __init serial_exit(void)
s/__init/__exit/
> +{
> + platform_device_unregister(&uart8250_device);
> +}
> +module_exit(serial_exit);
Paul Bolle
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] mips: make loongsoon serial driver explicitly modular
2015-06-02 21:47 ` Paul Bolle
@ 2015-06-02 22:43 ` Paul Gortmaker
2015-06-02 22:43 ` Paul Gortmaker
0 siblings, 1 reply; 12+ messages in thread
From: Paul Gortmaker @ 2015-06-02 22:43 UTC (permalink / raw)
To: Paul Bolle; +Cc: linux-kernel, Ralf Baechle, linux-mips
[Re: [PATCH 3/4] mips: make loongsoon serial driver explicitly modular] On 02/06/2015 (Tue 23:47) Paul Bolle wrote:
> On Tue, 2015-06-02 at 16:16 -0400, Paul Gortmaker wrote:
> > +static void __init serial_exit(void)
>
> s/__init/__exit/
Argh, yes thanks for spotting that copy-n-waste error. Will fix.
Paul.
--
>
> > +{
> > + platform_device_unregister(&uart8250_device);
> > +}
> > +module_exit(serial_exit);
>
>
> Paul Bolle
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] mips: make loongsoon serial driver explicitly modular
2015-06-02 22:43 ` Paul Gortmaker
@ 2015-06-02 22:43 ` Paul Gortmaker
0 siblings, 0 replies; 12+ messages in thread
From: Paul Gortmaker @ 2015-06-02 22:43 UTC (permalink / raw)
To: Paul Bolle; +Cc: linux-kernel, Ralf Baechle, linux-mips
[Re: [PATCH 3/4] mips: make loongsoon serial driver explicitly modular] On 02/06/2015 (Tue 23:47) Paul Bolle wrote:
> On Tue, 2015-06-02 at 16:16 -0400, Paul Gortmaker wrote:
> > +static void __init serial_exit(void)
>
> s/__init/__exit/
Argh, yes thanks for spotting that copy-n-waste error. Will fix.
Paul.
--
>
> > +{
> > + platform_device_unregister(&uart8250_device);
> > +}
> > +module_exit(serial_exit);
>
>
> Paul Bolle
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] mips: make loongsoon serial driver explicitly modular
2015-06-02 20:16 ` [PATCH 3/4] mips: make loongsoon serial driver explicitly modular Paul Gortmaker
2015-06-02 20:16 ` Paul Gortmaker
2015-06-02 21:47 ` Paul Bolle
@ 2015-06-03 7:55 ` Ralf Baechle
2015-06-09 7:35 ` Ralf Baechle
3 siblings, 0 replies; 12+ messages in thread
From: Ralf Baechle @ 2015-06-03 7:55 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: linux-kernel, linux-mips
On Tue, Jun 02, 2015 at 04:16:07PM -0400, Paul Gortmaker wrote:
Bad timing for a Loongson patch - I just applied a patch that moves
every file around. I resolved that conflict and applied your patch.
Ralf
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] mips: make loongsoon serial driver explicitly modular
2015-06-02 20:16 ` [PATCH 3/4] mips: make loongsoon serial driver explicitly modular Paul Gortmaker
` (2 preceding siblings ...)
2015-06-03 7:55 ` Ralf Baechle
@ 2015-06-09 7:35 ` Ralf Baechle
2015-06-09 23:15 ` Paul Gortmaker
3 siblings, 1 reply; 12+ messages in thread
From: Ralf Baechle @ 2015-06-09 7:35 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: linux-kernel, linux-mips, Huacai Chen, Aaro Koskinen
On Tue, Jun 02, 2015 at 04:16:07PM -0400, Paul Gortmaker wrote:
Ccing a few people with interest in Loongson stuff.
> 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.
Following up on our IRC discussion - your commit would result in
platform device registrations from module code which opens another can
of worms. This and the whole philosophy of platforms devices to show
what devices do exist in a system, not which drivers are configured.
So just always build serial.c into the kernel.
A related issue is uart_base.o which I think is required to register
properly initialized platform devices. It depends on
CONFIG_LOONGSON_UART_BASE but probably should also be put into the
kernel whenever we register the UART platform devices and that's
always.
Ralf
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
diff --git a/arch/mips/loongson/common/Makefile b/arch/mips/loongson/common/Makefile
index e70c33f..f2e8153 100644
--- a/arch/mips/loongson/common/Makefile
+++ b/arch/mips/loongson/common/Makefile
@@ -3,15 +3,13 @@
#
obj-y += setup.o init.o cmdline.o env.o time.o reset.o irq.o \
- bonito-irq.o mem.o machtype.o platform.o
+ bonito-irq.o mem.o machtype.o platform.o serial.o
obj-$(CONFIG_PCI) += pci.o
#
# Serial port support
#
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
-loongson-serial-$(CONFIG_SERIAL_8250) := serial.o
-obj-y += $(loongson-serial-m) $(loongson-serial-y)
obj-$(CONFIG_LOONGSON_UART_BASE) += uart_base.o
obj-$(CONFIG_LOONGSON_MC146818) += rtc.o
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] mips: make loongsoon serial driver explicitly modular
2015-06-09 7:35 ` Ralf Baechle
@ 2015-06-09 23:15 ` Paul Gortmaker
2015-06-09 23:15 ` Paul Gortmaker
2015-06-10 8:47 ` Ralf Baechle
0 siblings, 2 replies; 12+ messages in thread
From: Paul Gortmaker @ 2015-06-09 23:15 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-kernel, linux-mips, Huacai Chen, Aaro Koskinen
[Re: [PATCH 3/4] mips: make loongsoon serial driver explicitly modular] On 09/06/2015 (Tue 09:35) Ralf Baechle wrote:
> On Tue, Jun 02, 2015 at 04:16:07PM -0400, Paul Gortmaker wrote:
>
> Ccing a few people with interest in Loongson stuff.
>
> > 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.
>
> Following up on our IRC discussion - your commit would result in
> platform device registrations from module code which opens another can
> of worms. This and the whole philosophy of platforms devices to show
> what devices do exist in a system, not which drivers are configured.
> So just always build serial.c into the kernel.
>
> A related issue is uart_base.o which I think is required to register
> properly initialized platform devices. It depends on
> CONFIG_LOONGSON_UART_BASE but probably should also be put into the
> kernel whenever we register the UART platform devices and that's
> always.
>
> Ralf
>
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
I've dropped my change in favour of this one, and crafted up a commit
log from this e-mail exchange as follows:
https://git.kernel.org/cgit/linux/kernel/git/paulg/linux.git/commit/?h=init-v4.1-rc6&id=5eee56adcce9b0baf2da55c0bff88eb0f1c0eb61
Assuming nobody else has an issue with it, then we should be done here
(i.e. it doesn't even need to be in mips-next; it just needs to be here
in this series so we don't get bisect fails introduced.)
Thanks,
Paul.
--
>
> diff --git a/arch/mips/loongson/common/Makefile b/arch/mips/loongson/common/Makefile
> index e70c33f..f2e8153 100644
> --- a/arch/mips/loongson/common/Makefile
> +++ b/arch/mips/loongson/common/Makefile
> @@ -3,15 +3,13 @@
> #
>
> obj-y += setup.o init.o cmdline.o env.o time.o reset.o irq.o \
> - bonito-irq.o mem.o machtype.o platform.o
> + bonito-irq.o mem.o machtype.o platform.o serial.o
> obj-$(CONFIG_PCI) += pci.o
>
> #
> # Serial port support
> #
> obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
> -loongson-serial-$(CONFIG_SERIAL_8250) := serial.o
> -obj-y += $(loongson-serial-m) $(loongson-serial-y)
> obj-$(CONFIG_LOONGSON_UART_BASE) += uart_base.o
> obj-$(CONFIG_LOONGSON_MC146818) += rtc.o
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] mips: make loongsoon serial driver explicitly modular
2015-06-09 23:15 ` Paul Gortmaker
@ 2015-06-09 23:15 ` Paul Gortmaker
2015-06-10 8:47 ` Ralf Baechle
1 sibling, 0 replies; 12+ messages in thread
From: Paul Gortmaker @ 2015-06-09 23:15 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-kernel, linux-mips, Huacai Chen, Aaro Koskinen
[Re: [PATCH 3/4] mips: make loongsoon serial driver explicitly modular] On 09/06/2015 (Tue 09:35) Ralf Baechle wrote:
> On Tue, Jun 02, 2015 at 04:16:07PM -0400, Paul Gortmaker wrote:
>
> Ccing a few people with interest in Loongson stuff.
>
> > 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.
>
> Following up on our IRC discussion - your commit would result in
> platform device registrations from module code which opens another can
> of worms. This and the whole philosophy of platforms devices to show
> what devices do exist in a system, not which drivers are configured.
> So just always build serial.c into the kernel.
>
> A related issue is uart_base.o which I think is required to register
> properly initialized platform devices. It depends on
> CONFIG_LOONGSON_UART_BASE but probably should also be put into the
> kernel whenever we register the UART platform devices and that's
> always.
>
> Ralf
>
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
I've dropped my change in favour of this one, and crafted up a commit
log from this e-mail exchange as follows:
https://git.kernel.org/cgit/linux/kernel/git/paulg/linux.git/commit/?h=init-v4.1-rc6&id=5eee56adcce9b0baf2da55c0bff88eb0f1c0eb61
Assuming nobody else has an issue with it, then we should be done here
(i.e. it doesn't even need to be in mips-next; it just needs to be here
in this series so we don't get bisect fails introduced.)
Thanks,
Paul.
--
>
> diff --git a/arch/mips/loongson/common/Makefile b/arch/mips/loongson/common/Makefile
> index e70c33f..f2e8153 100644
> --- a/arch/mips/loongson/common/Makefile
> +++ b/arch/mips/loongson/common/Makefile
> @@ -3,15 +3,13 @@
> #
>
> obj-y += setup.o init.o cmdline.o env.o time.o reset.o irq.o \
> - bonito-irq.o mem.o machtype.o platform.o
> + bonito-irq.o mem.o machtype.o platform.o serial.o
> obj-$(CONFIG_PCI) += pci.o
>
> #
> # Serial port support
> #
> obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
> -loongson-serial-$(CONFIG_SERIAL_8250) := serial.o
> -obj-y += $(loongson-serial-m) $(loongson-serial-y)
> obj-$(CONFIG_LOONGSON_UART_BASE) += uart_base.o
> obj-$(CONFIG_LOONGSON_MC146818) += rtc.o
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] mips: make loongsoon serial driver explicitly modular
2015-06-09 23:15 ` Paul Gortmaker
2015-06-09 23:15 ` Paul Gortmaker
@ 2015-06-10 8:47 ` Ralf Baechle
1 sibling, 0 replies; 12+ messages in thread
From: Ralf Baechle @ 2015-06-10 8:47 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: linux-kernel, linux-mips, Huacai Chen, Aaro Koskinen
On Tue, Jun 09, 2015 at 07:15:28PM -0400, Paul Gortmaker wrote:
> I've dropped my change in favour of this one, and crafted up a commit
> log from this e-mail exchange as follows:
>
> https://git.kernel.org/cgit/linux/kernel/git/paulg/linux.git/commit/?h=init-v4.1-rc6&id=5eee56adcce9b0baf2da55c0bff88eb0f1c0eb61
>
> Assuming nobody else has an issue with it, then we should be done here
> (i.e. it doesn't even need to be in mips-next; it just needs to be here
> in this series so we don't get bisect fails introduced.)
I've committed this as d9fb5660459819513d510e72caa3120a7cf41ee1 (MIPS:
Loongson: Do not register 8250 platform device from module.) on my
4.1-fixes branch and intend to send it out on Friday to Linus.
Still nothing heared about the uart_base.o situation.
Ralf
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-06-10 8:47 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-02 20:16 [PATCH 0/4] Relocate module code from init.h to module.h Paul Gortmaker
2015-06-02 20:16 ` Paul Gortmaker
2015-06-02 20:16 ` [PATCH 3/4] mips: make loongsoon serial driver explicitly modular Paul Gortmaker
2015-06-02 20:16 ` Paul Gortmaker
2015-06-02 21:47 ` Paul Bolle
2015-06-02 22:43 ` Paul Gortmaker
2015-06-02 22:43 ` Paul Gortmaker
2015-06-03 7:55 ` Ralf Baechle
2015-06-09 7:35 ` Ralf Baechle
2015-06-09 23:15 ` Paul Gortmaker
2015-06-09 23:15 ` Paul Gortmaker
2015-06-10 8:47 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox