Skip to content

Commit a8cedfe

Browse files
Paul Gortmakergregkh
authored andcommitted
drivers/char: make hpet.c explicitly non-modular
The Kconfig currently controlling compilation of this code is: char/Kconfig:config HPET char/Kconfig: bool "HPET - High Precision Event Timer" if (X86 || IA64) ...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. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We leave some tags like MODULE_AUTHOR for documentation purposes. Cc: Arnd Bergmann <arnd@arndb.de> Cc: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ff6f464 commit a8cedfe

1 file changed

Lines changed: 3 additions & 22 deletions

File tree

‎drivers/char/hpet.c‎

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*/
1313

1414
#include <linux/interrupt.h>
15-
#include <linux/module.h>
1615
#include <linux/kernel.h>
1716
#include <linux/types.h>
1817
#include <linux/miscdevice.h>
@@ -1043,24 +1042,16 @@ static int hpet_acpi_add(struct acpi_device *device)
10431042
return hpet_alloc(&data);
10441043
}
10451044

1046-
static int hpet_acpi_remove(struct acpi_device *device)
1047-
{
1048-
/* XXX need to unregister clocksource, dealloc mem, etc */
1049-
return -EINVAL;
1050-
}
1051-
10521045
static const struct acpi_device_id hpet_device_ids[] = {
10531046
{"PNP0103", 0},
10541047
{"", 0},
10551048
};
1056-
MODULE_DEVICE_TABLE(acpi, hpet_device_ids);
10571049

10581050
static struct acpi_driver hpet_acpi_driver = {
10591051
.name = "hpet",
10601052
.ids = hpet_device_ids,
10611053
.ops = {
10621054
.add = hpet_acpi_add,
1063-
.remove = hpet_acpi_remove,
10641055
},
10651056
};
10661057

@@ -1086,19 +1077,9 @@ static int __init hpet_init(void)
10861077

10871078
return 0;
10881079
}
1080+
device_initcall(hpet_init);
10891081

1090-
static void __exit hpet_exit(void)
1091-
{
1092-
acpi_bus_unregister_driver(&hpet_acpi_driver);
1093-
1094-
if (sysctl_header)
1095-
unregister_sysctl_table(sysctl_header);
1096-
misc_deregister(&hpet_misc);
1097-
1098-
return;
1099-
}
1100-
1101-
module_init(hpet_init);
1102-
module_exit(hpet_exit);
1082+
/*
11031083
MODULE_AUTHOR("Bob Picco <Robert.Picco@hp.com>");
11041084
MODULE_LICENSE("GPL");
1085+
*/

0 commit comments

Comments
 (0)