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

reset: ath79: make it explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/reset/Kconfig:config RESET_ATH79
drivers/reset/Kconfig: bool "AR71xx Reset Driver" if COMPILE_TEST

...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
was (or is now) contained at the top of the file in the comments.

Cc: Alban Bedel <albeu@free.fr>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Alban Bedel <albeu@free.fr>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

authored by

Paul Gortmaker and committed by
Philipp Zabel
90ce95ab 80b8b1a1

+8 -19
+8 -19
drivers/reset/reset-ath79.c
··· 1 1 /* 2 + * AR71xx Reset Controller Driver 3 + * Author: Alban Bedel 4 + * 2 5 * Copyright (C) 2015 Alban Bedel <albeu@free.fr> 3 6 * 4 7 * This program is free software; you can redistribute it and/or modify ··· 16 13 */ 17 14 18 15 #include <linux/io.h> 19 - #include <linux/module.h> 16 + #include <linux/init.h> 20 17 #include <linux/platform_device.h> 21 18 #include <linux/reset-controller.h> 22 19 #include <linux/reboot.h> ··· 130 127 return 0; 131 128 } 132 129 133 - static int ath79_reset_remove(struct platform_device *pdev) 134 - { 135 - struct ath79_reset *ath79_reset = platform_get_drvdata(pdev); 136 - 137 - unregister_restart_handler(&ath79_reset->restart_nb); 138 - 139 - return 0; 140 - } 141 - 142 130 static const struct of_device_id ath79_reset_dt_ids[] = { 143 131 { .compatible = "qca,ar7100-reset", }, 144 132 { }, 145 133 }; 146 - MODULE_DEVICE_TABLE(of, ath79_reset_dt_ids); 147 134 148 135 static struct platform_driver ath79_reset_driver = { 149 136 .probe = ath79_reset_probe, 150 - .remove = ath79_reset_remove, 151 137 .driver = { 152 - .name = "ath79-reset", 153 - .of_match_table = ath79_reset_dt_ids, 138 + .name = "ath79-reset", 139 + .of_match_table = ath79_reset_dt_ids, 140 + .suppress_bind_attrs = true, 154 141 }, 155 142 }; 156 - module_platform_driver(ath79_reset_driver); 157 - 158 - MODULE_AUTHOR("Alban Bedel <albeu@free.fr>"); 159 - MODULE_DESCRIPTION("AR71xx Reset Controller Driver"); 160 - MODULE_LICENSE("GPL"); 143 + builtin_platform_driver(ath79_reset_driver);