From patchwork Wed Aug 24 20:57:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Gortmaker X-Patchwork-Id: 9298351 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4DDC4608A7 for ; Wed, 24 Aug 2016 20:59:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F49E290FF for ; Wed, 24 Aug 2016 20:59:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3459B2911B; Wed, 24 Aug 2016 20:59:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A999029104 for ; Wed, 24 Aug 2016 20:59:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756345AbcHXU6c (ORCPT ); Wed, 24 Aug 2016 16:58:32 -0400 Received: from mail.windriver.com ([147.11.1.11]:51852 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933198AbcHXU62 (ORCPT ); Wed, 24 Aug 2016 16:58:28 -0400 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.15.2/8.15.1) with ESMTPS id u7OKwOTK020782 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 24 Aug 2016 13:58:24 -0700 (PDT) Received: from yow-lpgnfs-02.wrs.com (128.224.149.8) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.248.2; Wed, 24 Aug 2016 13:58:23 -0700 From: Paul Gortmaker To: CC: Paul Gortmaker , Bjorn Helgaas , , Subject: [PATCH 9/9] PCI: hotplug: make PCIe core code explicitly non-modular Date: Wed, 24 Aug 2016 16:57:52 -0400 Message-ID: <20160824205752.12024-10-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20160824205752.12024-1-paul.gortmaker@windriver.com> References: <20160824205752.12024-1-paul.gortmaker@windriver.com> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The Makefile fragments currently controlling compilation of this code are: obj-$(CONFIG_HOTPLUG_PCI_PCIE) += pciehp.o [...] pciehp-objs := pciehp_core.o \ The Kconfig currently controlling compilation of this code is: drivers/pci/pcie/Kconfig:config HOTPLUG_PCI_PCIE drivers/pci/pcie/Kconfig: bool "PCI Express Hotplug driver" ...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. However one could argue that we should use subsys_initcall() here, but for now we stick with runtime equivalence. We delete module.h but we keep the moduleparam.h include, since we are keeping the module_param() that the file has as-is for now. We also delete the MODULE_LICENSE tag etc since all that information is still contained higher up in the file via the DEFINE lines which now serve as documentation only. Cc: Bjorn Helgaas Cc: kristen.c.accardi@intel.com Cc: linux-pci@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/hotplug/pciehp_core.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index ac531e674a05..fb0f86335158 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c @@ -27,7 +27,6 @@ * */ -#include #include #include #include @@ -47,10 +46,10 @@ static bool pciehp_force; #define DRIVER_AUTHOR "Dan Zink , Greg Kroah-Hartman , Dely Sy " #define DRIVER_DESC "PCI Express Hot Plug Controller Driver" -MODULE_AUTHOR(DRIVER_AUTHOR); -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_LICENSE("GPL"); - +/* + * not really modular, but the easiest way to keep compat with existing + * bootargs behaviour is to continue using module_param here. + */ module_param(pciehp_debug, bool, 0644); module_param(pciehp_poll_mode, bool, 0644); module_param(pciehp_poll_time, int, 0644); @@ -337,13 +336,4 @@ static int __init pcied_init(void) return retval; } - -static void __exit pcied_cleanup(void) -{ - dbg("unload_pciehpd()\n"); - pcie_port_service_unregister(&hpdriver_portdrv); - info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n"); -} - -module_init(pcied_init); -module_exit(pcied_cleanup); +device_initcall(pcied_init);