mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	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>
This commit is contained in:
		
							parent
							
								
									fadb03cd46
								
							
						
					
					
						commit
						cdd24f76fe
					
				
					 1 changed files with 5 additions and 27 deletions
				
			
		| 
						 | 
					@ -13,7 +13,7 @@
 | 
				
			||||||
#include <linux/delay.h>
 | 
					#include <linux/delay.h>
 | 
				
			||||||
#include <linux/err.h>
 | 
					#include <linux/err.h>
 | 
				
			||||||
#include <linux/io.h>
 | 
					#include <linux/io.h>
 | 
				
			||||||
#include <linux/module.h>
 | 
					#include <linux/init.h>
 | 
				
			||||||
#include <linux/of.h>
 | 
					#include <linux/of.h>
 | 
				
			||||||
#include <linux/platform_device.h>
 | 
					#include <linux/platform_device.h>
 | 
				
			||||||
#include <linux/reboot.h>
 | 
					#include <linux/reboot.h>
 | 
				
			||||||
| 
						 | 
					@ -218,39 +218,17 @@ static int lpc18xx_rgu_probe(struct platform_device *pdev)
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int lpc18xx_rgu_remove(struct platform_device *pdev)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	struct lpc18xx_rgu_data *rc = platform_get_drvdata(pdev);
 | 
					 | 
				
			||||||
	int ret;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	ret = unregister_restart_handler(&rc->restart_nb);
 | 
					 | 
				
			||||||
	if (ret)
 | 
					 | 
				
			||||||
		dev_warn(&pdev->dev, "failed to unregister restart handler\n");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	reset_controller_unregister(&rc->rcdev);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	clk_disable_unprepare(rc->clk_delay);
 | 
					 | 
				
			||||||
	clk_disable_unprepare(rc->clk_reg);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static const struct of_device_id lpc18xx_rgu_match[] = {
 | 
					static const struct of_device_id lpc18xx_rgu_match[] = {
 | 
				
			||||||
	{ .compatible = "nxp,lpc1850-rgu" },
 | 
						{ .compatible = "nxp,lpc1850-rgu" },
 | 
				
			||||||
	{ }
 | 
						{ }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
MODULE_DEVICE_TABLE(of, lpc18xx_rgu_match);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
static struct platform_driver lpc18xx_rgu_driver = {
 | 
					static struct platform_driver lpc18xx_rgu_driver = {
 | 
				
			||||||
	.probe	= lpc18xx_rgu_probe,
 | 
						.probe	= lpc18xx_rgu_probe,
 | 
				
			||||||
	.remove	= lpc18xx_rgu_remove,
 | 
					 | 
				
			||||||
	.driver	= {
 | 
						.driver	= {
 | 
				
			||||||
		.name			= "lpc18xx-reset",
 | 
							.name			= "lpc18xx-reset",
 | 
				
			||||||
		.of_match_table		= lpc18xx_rgu_match,
 | 
							.of_match_table		= lpc18xx_rgu_match,
 | 
				
			||||||
 | 
							.suppress_bind_attrs	= true,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
module_platform_driver(lpc18xx_rgu_driver);
 | 
					builtin_platform_driver(lpc18xx_rgu_driver);
 | 
				
			||||||
 | 
					 | 
				
			||||||
MODULE_AUTHOR("Joachim Eastwood <manabian@gmail.com>");
 | 
					 | 
				
			||||||
MODULE_DESCRIPTION("Reset driver for LPC18xx/43xx RGU");
 | 
					 | 
				
			||||||
MODULE_LICENSE("GPL v2");
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue