Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

leds: ledtrig-cpu: Make the driver explicitly non-modular

The Kconfig for this driver is currently:

config LEDS_TRIGGER_CPU
bool "LED CPU Trigger"

...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 also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Bryan Wu <cooloney@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: linux-leds@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>

authored by

Paul Gortmaker and committed by
Jacek Anaszewski
227a0ca1 6e25e641

+1 -25
+1 -25
drivers/leds/trigger/ledtrig-cpu.c
··· 19 19 * 20 20 */ 21 21 22 - #include <linux/module.h> 23 22 #include <linux/kernel.h> 24 23 #include <linux/init.h> 25 24 #include <linux/slab.h> ··· 139 140 140 141 return 0; 141 142 } 142 - module_init(ledtrig_cpu_init); 143 - 144 - static void __exit ledtrig_cpu_exit(void) 145 - { 146 - int cpu; 147 - 148 - unregister_cpu_notifier(&ledtrig_cpu_nb); 149 - 150 - for_each_possible_cpu(cpu) { 151 - struct led_trigger_cpu *trig = &per_cpu(cpu_trig, cpu); 152 - 153 - led_trigger_unregister_simple(trig->_trig); 154 - trig->_trig = NULL; 155 - memset(trig->name, 0, MAX_NAME_LEN); 156 - } 157 - 158 - unregister_syscore_ops(&ledtrig_cpu_syscore_ops); 159 - } 160 - module_exit(ledtrig_cpu_exit); 161 - 162 - MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); 163 - MODULE_AUTHOR("Bryan Wu <bryan.wu@canonical.com>"); 164 - MODULE_DESCRIPTION("CPU LED trigger"); 165 - MODULE_LICENSE("GPL"); 143 + device_initcall(ledtrig_cpu_init);