Message ID | 1459116497-19991-3-git-send-email-paul.gortmaker@windriver.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
On 03/27/2016 05:08 PM, Paul Gortmaker wrote: > The Makefile/Kconfig currently controlling compilation of this code is: > > obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \ > signal_64.o ptrace32.o \ > paca.o nvram_64.o firmware.o > > arch/powerpc/platforms/Kconfig.cputype:config PPC64 > arch/powerpc/platforms/Kconfig.cputype: bool "64-bit kernel" > > ...meaning that it currently is not being built as a module by anyone. > > Lets remove the modular code that is essentially orphaned, so that > when reading the driver there is no doubt it is builtin-only. > > Since module_init translates to device_initcall in the non-modular > case, the init ordering remains unchanged with this commit. > > We don't replace module.h with init.h since the file already has that. > > We delete the MODULE_LICENSE tag since that information is already > contained at the top of the file in the comments. > > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> > Cc: Paul Mackerras <paulus@samba.org> > Cc: Michael Ellerman <mpe@ellerman.id.au> > Cc: Hari Bathini <hbathini@linux.vnet.ibm.com> > Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com> > Cc: Andrzej Hajda <a.hajda@samsung.com> > Cc: Anton Blanchard <anton@samba.org> > Cc: linuxppc-dev@lists.ozlabs.org > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> > --- I think at some point in the past we thought this may be useful as a module but I'm not sure it has ever been used that way. Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com> > arch/powerpc/kernel/nvram_64.c | 12 +----------- > 1 file changed, 1 insertion(+), 11 deletions(-) > > diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c > index 0cab9e8c3794..856f9a7944cd 100644 > --- a/arch/powerpc/kernel/nvram_64.c > +++ b/arch/powerpc/kernel/nvram_64.c > @@ -15,8 +15,6 @@ > * parsing code. > */ > > -#include <linux/module.h> > - > #include <linux/types.h> > #include <linux/errno.h> > #include <linux/fs.h> > @@ -1231,12 +1229,4 @@ static int __init nvram_init(void) > > return rc; > } > - > -static void __exit nvram_cleanup(void) > -{ > - misc_deregister( &nvram_dev ); > -} > - > -module_init(nvram_init); > -module_exit(nvram_cleanup); > -MODULE_LICENSE("GPL"); > +device_initcall(nvram_init); >
On Sun, 2016-27-03 at 22:08:16 UTC, Paul Gortmaker wrote: > The Makefile/Kconfig currently controlling compilation of this code is: > > obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \ > signal_64.o ptrace32.o \ > paca.o nvram_64.o firmware.o > > arch/powerpc/platforms/Kconfig.cputype:config PPC64 > arch/powerpc/platforms/Kconfig.cputype: bool "64-bit kernel" > > ...meaning that it currently is not being built as a module by anyone. > > Lets remove the modular code that is essentially orphaned, so that > when reading the driver there is no doubt it is builtin-only. ... > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> > Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com> Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/c0c523897d1f83bc8484cb58d1 cheers
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index 0cab9e8c3794..856f9a7944cd 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c @@ -15,8 +15,6 @@ * parsing code. */ -#include <linux/module.h> - #include <linux/types.h> #include <linux/errno.h> #include <linux/fs.h> @@ -1231,12 +1229,4 @@ static int __init nvram_init(void) return rc; } - -static void __exit nvram_cleanup(void) -{ - misc_deregister( &nvram_dev ); -} - -module_init(nvram_init); -module_exit(nvram_cleanup); -MODULE_LICENSE("GPL"); +device_initcall(nvram_init);
The Makefile/Kconfig currently controlling compilation of this code is: obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \ signal_64.o ptrace32.o \ paca.o nvram_64.o firmware.o arch/powerpc/platforms/Kconfig.cputype:config PPC64 arch/powerpc/platforms/Kconfig.cputype: bool "64-bit kernel" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. We don't replace module.h with init.h since the file already has that. We delete the MODULE_LICENSE tag since that information is already contained at the top of the file in the comments. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Hari Bathini <hbathini@linux.vnet.ibm.com> Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com> Cc: Andrzej Hajda <a.hajda@samsung.com> Cc: Anton Blanchard <anton@samba.org> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> --- arch/powerpc/kernel/nvram_64.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)