Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2992800AbbHHUho (ORCPT ); Sat, 8 Aug 2015 16:37:44 -0400 Received: from mail1.windriver.com ([147.11.146.13]:60009 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2992648AbbHHUhm (ORCPT ); Sat, 8 Aug 2015 16:37:42 -0400 From: Paul Gortmaker To: CC: Paul Gortmaker , Arnd Bergmann , Greg Kroah-Hartman , Clemens Ladisch Subject: [PATCH 3/4] drivers/char: make hpet.c explicitly non-modular Date: Sat, 8 Aug 2015 16:35:04 -0400 Message-ID: <1439066105-18412-4-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1439066105-18412-1-git-send-email-paul.gortmaker@windriver.com> References: <1439066105-18412-1-git-send-email-paul.gortmaker@windriver.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2569 Lines: 95 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 Cc: Greg Kroah-Hartman Cc: Clemens Ladisch Signed-off-by: Paul Gortmaker --- drivers/char/hpet.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 5c0baa9ffc64..240b6cf1d97c 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c @@ -12,7 +12,6 @@ */ #include -#include #include #include #include @@ -1043,24 +1042,16 @@ static int hpet_acpi_add(struct acpi_device *device) return hpet_alloc(&data); } -static int hpet_acpi_remove(struct acpi_device *device) -{ - /* XXX need to unregister clocksource, dealloc mem, etc */ - return -EINVAL; -} - static const struct acpi_device_id hpet_device_ids[] = { {"PNP0103", 0}, {"", 0}, }; -MODULE_DEVICE_TABLE(acpi, hpet_device_ids); static struct acpi_driver hpet_acpi_driver = { .name = "hpet", .ids = hpet_device_ids, .ops = { .add = hpet_acpi_add, - .remove = hpet_acpi_remove, }, }; @@ -1086,19 +1077,9 @@ static int __init hpet_init(void) return 0; } +device_initcall(hpet_init); -static void __exit hpet_exit(void) -{ - acpi_bus_unregister_driver(&hpet_acpi_driver); - - if (sysctl_header) - unregister_sysctl_table(sysctl_header); - misc_deregister(&hpet_misc); - - return; -} - -module_init(hpet_init); -module_exit(hpet_exit); +/* MODULE_AUTHOR("Bob Picco "); MODULE_LICENSE("GPL"); +*/ -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/