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

reset: lpc18xx: make it explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/reset/Kconfig:config RESET_LPC18XX
drivers/reset/Kconfig: bool "LPC18xx/43xx Reset Driver" if COMPILE_TEST
drivers/reset/Kconfig: default ARCH_LPC18XX

or

arch/arm/Kconfig:config ARCH_LPC18XX
arch/arm/Kconfig: bool "NXP LPC18xx/LPC43xx"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

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: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

authored by

Paul Gortmaker and committed by
Philipp Zabel
cdd24f76 fadb03cd

+5 -27
+5 -27
drivers/reset/reset-lpc18xx.c
··· 13 13 #include <linux/delay.h> 14 14 #include <linux/err.h> 15 15 #include <linux/io.h> 16 - #include <linux/module.h> 16 + #include <linux/init.h> 17 17 #include <linux/of.h> 18 18 #include <linux/platform_device.h> 19 19 #include <linux/reboot.h> ··· 218 218 return ret; 219 219 } 220 220 221 - static int lpc18xx_rgu_remove(struct platform_device *pdev) 222 - { 223 - struct lpc18xx_rgu_data *rc = platform_get_drvdata(pdev); 224 - int ret; 225 - 226 - ret = unregister_restart_handler(&rc->restart_nb); 227 - if (ret) 228 - dev_warn(&pdev->dev, "failed to unregister restart handler\n"); 229 - 230 - reset_controller_unregister(&rc->rcdev); 231 - 232 - clk_disable_unprepare(rc->clk_delay); 233 - clk_disable_unprepare(rc->clk_reg); 234 - 235 - return 0; 236 - } 237 - 238 221 static const struct of_device_id lpc18xx_rgu_match[] = { 239 222 { .compatible = "nxp,lpc1850-rgu" }, 240 223 { } 241 224 }; 242 - MODULE_DEVICE_TABLE(of, lpc18xx_rgu_match); 243 225 244 226 static struct platform_driver lpc18xx_rgu_driver = { 245 227 .probe = lpc18xx_rgu_probe, 246 - .remove = lpc18xx_rgu_remove, 247 228 .driver = { 248 - .name = "lpc18xx-reset", 249 - .of_match_table = lpc18xx_rgu_match, 229 + .name = "lpc18xx-reset", 230 + .of_match_table = lpc18xx_rgu_match, 231 + .suppress_bind_attrs = true, 250 232 }, 251 233 }; 252 - module_platform_driver(lpc18xx_rgu_driver); 253 - 254 - MODULE_AUTHOR("Joachim Eastwood <manabian@gmail.com>"); 255 - MODULE_DESCRIPTION("Reset driver for LPC18xx/43xx RGU"); 256 - MODULE_LICENSE("GPL v2"); 234 + builtin_platform_driver(lpc18xx_rgu_driver);