* [PATCH 1/9] PCI: PCIe dpc: make it explicitly non-modular
2016-08-24 20:57 [PATCH 0/9] PCI: final demodularization of non-modular code Paul Gortmaker
@ 2016-08-24 20:57 ` Paul Gortmaker
2016-08-24 20:57 ` [PATCH 2/9] PCI: PCIe pme: " Paul Gortmaker
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Paul Gortmaker @ 2016-08-24 20:57 UTC (permalink / raw)
To: linux-kernel
Cc: Paul Gortmaker, Bjorn Helgaas, Keith Busch, Mika Westerberg, linux-pci
The Kconfig currently controlling compilation of this code is:
drivers/pci/pcie/Kconfig:config PCIE_DPC
drivers/pci/pcie/Kconfig: bool "PCIe Downstream Port Containment support"
...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 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: Bjorn Helgaas <bhelgaas@google.com>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/pci/pcie/pcie-dpc.c | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/drivers/pci/pcie/pcie-dpc.c b/drivers/pci/pcie/pcie-dpc.c
index 250f87861786..9811b14d9ad8 100644
--- a/drivers/pci/pcie/pcie-dpc.c
+++ b/drivers/pci/pcie/pcie-dpc.c
@@ -1,5 +1,7 @@
/*
* PCI Express Downstream Port Containment services driver
+ * Author: Keith Busch <keith.busch@intel.com>
+ *
* Copyright (C) 2016 Intel Corp.
*
* This file is subject to the terms and conditions of the GNU General Public
@@ -9,7 +11,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/pci.h>
#include <linux/pcieport_if.h>
@@ -143,16 +145,4 @@ static int __init dpc_service_init(void)
{
return pcie_port_service_register(&dpcdriver);
}
-
-static void __exit dpc_service_exit(void)
-{
- pcie_port_service_unregister(&dpcdriver);
-}
-
-MODULE_DESCRIPTION("PCI Express Downstream Port Containment driver");
-MODULE_AUTHOR("Keith Busch <keith.busch@intel.com>");
-MODULE_LICENSE("GPL");
-MODULE_VERSION("0.1");
-
-module_init(dpc_service_init);
-module_exit(dpc_service_exit);
+device_initcall(dpc_service_init);
--
2.8.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/9] PCI: PCIe pme: make it explicitly non-modular
2016-08-24 20:57 [PATCH 0/9] PCI: final demodularization of non-modular code Paul Gortmaker
2016-08-24 20:57 ` [PATCH 1/9] PCI: PCIe dpc: make it explicitly non-modular Paul Gortmaker
@ 2016-08-24 20:57 ` Paul Gortmaker
2016-08-24 20:57 ` [PATCH 3/9] PCI: PCIe aerdrv: " Paul Gortmaker
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Paul Gortmaker @ 2016-08-24 20:57 UTC (permalink / raw)
To: linux-kernel; +Cc: Paul Gortmaker, Bjorn Helgaas, linux-pci
The Kconfig for this option is currently:
config PCIE_PME
def_bool y
depends on PCIEPORTBUS && PM
...where both dependencies are also bool items. That means it currently
is not being built as a module by anyone. Lets remove all traces of
modularity, so that when reading the code, there is no doubt it is
builtin-only.
As part of that, we delete the .remove function, since that doesn't
seem to have a sensible use case. With "normal" endpoint drivers,
we have in the past set the suppress_bind_attrs bit to make it clear
that the use of ".remove" in a built-in driver was deleted, but here
for PCI, it would seem to be overkill to jump through the
pcie_port_service_driver and into the struct device_driver in order
to finally try and do something similar with the bind setting.
Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.
We don't exchange module.h for init.h since this file already has it.
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/pci/pcie/pme.c | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
index 1ae4c73e7a3c..884bad5320f8 100644
--- a/drivers/pci/pcie/pme.c
+++ b/drivers/pci/pcie/pme.c
@@ -10,7 +10,6 @@
* for more details.
*/
-#include <linux/module.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/errno.h>
@@ -449,17 +448,6 @@ static int pcie_pme_resume(struct pcie_device *srv)
return 0;
}
-/**
- * pcie_pme_remove - Prepare PCIe PME service device for removal.
- * @srv - PCIe service device to remove.
- */
-static void pcie_pme_remove(struct pcie_device *srv)
-{
- pcie_pme_suspend(srv);
- free_irq(srv->irq, srv);
- kfree(get_service_data(srv));
-}
-
static struct pcie_port_service_driver pcie_pme_driver = {
.name = "pcie_pme",
.port_type = PCI_EXP_TYPE_ROOT_PORT,
@@ -468,7 +456,6 @@ static struct pcie_port_service_driver pcie_pme_driver = {
.probe = pcie_pme_probe,
.suspend = pcie_pme_suspend,
.resume = pcie_pme_resume,
- .remove = pcie_pme_remove,
};
/**
@@ -478,5 +465,4 @@ static int __init pcie_pme_service_init(void)
{
return pcie_port_service_register(&pcie_pme_driver);
}
-
-module_init(pcie_pme_service_init);
+device_initcall(pcie_pme_service_init);
--
2.8.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/9] PCI: PCIe aerdrv: make it explicitly non-modular
2016-08-24 20:57 [PATCH 0/9] PCI: final demodularization of non-modular code Paul Gortmaker
2016-08-24 20:57 ` [PATCH 1/9] PCI: PCIe dpc: make it explicitly non-modular Paul Gortmaker
2016-08-24 20:57 ` [PATCH 2/9] PCI: PCIe pme: " Paul Gortmaker
@ 2016-08-24 20:57 ` Paul Gortmaker
2016-08-24 20:57 ` [PATCH 4/9] PCI: dra7xx: make host code " Paul Gortmaker
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Paul Gortmaker @ 2016-08-24 20:57 UTC (permalink / raw)
To: linux-kernel; +Cc: Paul Gortmaker, Bjorn Helgaas, Tom Long Nguyen, linux-pci
The Makefile fragments currently controlling compilation of this code are:
obj-$(CONFIG_PCIEAER) += aerdriver.o
aerdriver-objs := aerdrv_errprint.o aerdrv_core.o aerdrv.o
The Kconfig currently controlling compilation of this code is:
drivers/pci/pcie/aer/Kconfig:config PCIEAER
drivers/pci/pcie/aer/Kconfig: bool "Root Port Advanced Error Reporting support"
...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.
We also delete the MODULE_LICENSE tag etc since all that information
is already contained earlier in the file.
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Tom Long Nguyen <tom.l.nguyen@intel.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/pci/pcie/aer/aerdrv.c | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c
index 48d21e0edd56..49805a48b81c 100644
--- a/drivers/pci/pcie/aer/aerdrv.c
+++ b/drivers/pci/pcie/aer/aerdrv.c
@@ -15,7 +15,6 @@
*
*/
-#include <linux/module.h>
#include <linux/pci.h>
#include <linux/pci-acpi.h>
#include <linux/sched.h>
@@ -37,9 +36,6 @@
#define DRIVER_VERSION "v1.0"
#define DRIVER_AUTHOR "tom.l.nguyen@intel.com"
#define DRIVER_DESC "Root Port Advanced Error Reporting Driver"
-MODULE_AUTHOR(DRIVER_AUTHOR);
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
static int aer_probe(struct pcie_device *dev);
static void aer_remove(struct pcie_device *dev);
@@ -417,16 +413,4 @@ static int __init aer_service_init(void)
return -ENXIO;
return pcie_port_service_register(&aerdriver);
}
-
-/**
- * aer_service_exit - unregister AER root service driver
- *
- * Invoked when AER root service driver is unloaded.
- */
-static void __exit aer_service_exit(void)
-{
- pcie_port_service_unregister(&aerdriver);
-}
-
-module_init(aer_service_init);
-module_exit(aer_service_exit);
+device_initcall(aer_service_init);
--
2.8.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/9] PCI: dra7xx: make host code explicitly non-modular
2016-08-24 20:57 [PATCH 0/9] PCI: final demodularization of non-modular code Paul Gortmaker
` (2 preceding siblings ...)
2016-08-24 20:57 ` [PATCH 3/9] PCI: PCIe aerdrv: " Paul Gortmaker
@ 2016-08-24 20:57 ` Paul Gortmaker
2016-08-24 20:57 ` [PATCH 5/9] PCI: PCIe qcom: " Paul Gortmaker
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Paul Gortmaker @ 2016-08-24 20:57 UTC (permalink / raw)
To: linux-kernel
Cc: Paul Gortmaker, Kishon Vijay Abraham I, Bjorn Helgaas,
linux-omap, linux-pci
The Kconfig currently controlling compilation of this code is:
drivers/pci/host/Kconfig:config PCI_DRA7XX
drivers/pci/host/Kconfig: bool "TI DRA7xx PCIe controller"
...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: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-omap@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/pci/host/pci-dra7xx.c | 31 +++----------------------------
1 file changed, 3 insertions(+), 28 deletions(-)
diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c
index 81b3949a26db..19223ed2e619 100644
--- a/drivers/pci/host/pci-dra7xx.c
+++ b/drivers/pci/host/pci-dra7xx.c
@@ -15,7 +15,7 @@
#include <linux/irq.h>
#include <linux/irqdomain.h>
#include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/of_gpio.h>
#include <linux/pci.h>
#include <linux/phy/phy.h>
@@ -443,25 +443,6 @@ err_phy:
return ret;
}
-static int __exit dra7xx_pcie_remove(struct platform_device *pdev)
-{
- struct dra7xx_pcie *dra7xx = platform_get_drvdata(pdev);
- struct pcie_port *pp = &dra7xx->pp;
- struct device *dev = &pdev->dev;
- int count = dra7xx->phy_count;
-
- if (pp->irq_domain)
- irq_domain_remove(pp->irq_domain);
- pm_runtime_put(dev);
- pm_runtime_disable(dev);
- while (count--) {
- phy_power_off(dra7xx->phy[count]);
- phy_exit(dra7xx->phy[count]);
- }
-
- return 0;
-}
-
#ifdef CONFIG_PM_SLEEP
static int dra7xx_pcie_suspend(struct device *dev)
{
@@ -545,19 +526,13 @@ static const struct of_device_id of_dra7xx_pcie_match[] = {
{ .compatible = "ti,dra7-pcie", },
{},
};
-MODULE_DEVICE_TABLE(of, of_dra7xx_pcie_match);
static struct platform_driver dra7xx_pcie_driver = {
- .remove = __exit_p(dra7xx_pcie_remove),
.driver = {
.name = "dra7-pcie",
.of_match_table = of_dra7xx_pcie_match,
+ .suppress_bind_attrs = true,
.pm = &dra7xx_pcie_pm_ops,
},
};
-
-module_platform_driver_probe(dra7xx_pcie_driver, dra7xx_pcie_probe);
-
-MODULE_AUTHOR("Kishon Vijay Abraham I <kishon@ti.com>");
-MODULE_DESCRIPTION("TI PCIe controller driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver_probe(dra7xx_pcie_driver, dra7xx_pcie_probe);
--
2.8.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 5/9] PCI: PCIe qcom: make host code explicitly non-modular
2016-08-24 20:57 [PATCH 0/9] PCI: final demodularization of non-modular code Paul Gortmaker
` (3 preceding siblings ...)
2016-08-24 20:57 ` [PATCH 4/9] PCI: dra7xx: make host code " Paul Gortmaker
@ 2016-08-24 20:57 ` Paul Gortmaker
2016-08-24 20:57 ` [PATCH 6/9] PCI: PCIe xilinx: " Paul Gortmaker
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Paul Gortmaker @ 2016-08-24 20:57 UTC (permalink / raw)
To: linux-kernel; +Cc: Paul Gortmaker, Stanimir Varbanov, Bjorn Helgaas, linux-pci
The Kconfig currently controlling compilation of this code is:
drivers/pci/host/Kconfig:config PCIE_QCOM
drivers/pci/host/Kconfig: bool "Qualcomm PCIe controller"
...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: Stanimir Varbanov <svarbanov@mm-sol.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/pci/host/pcie-qcom.c | 28 +++++++---------------------
1 file changed, 7 insertions(+), 21 deletions(-)
diff --git a/drivers/pci/host/pcie-qcom.c b/drivers/pci/host/pcie-qcom.c
index f2f90c50f75d..5ec2d440a6b7 100644
--- a/drivers/pci/host/pcie-qcom.c
+++ b/drivers/pci/host/pcie-qcom.c
@@ -1,7 +1,11 @@
/*
+ * Qualcomm PCIe root complex driver
+ *
* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
* Copyright 2015 Linaro Limited.
*
+ * Author: Stanimir Varbanov <svarbanov@mm-sol.com>
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
@@ -19,7 +23,7 @@
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/of_device.h>
#include <linux/of_gpio.h>
#include <linux/pci.h>
@@ -570,37 +574,19 @@ static int qcom_pcie_probe(struct platform_device *pdev)
return 0;
}
-static int qcom_pcie_remove(struct platform_device *pdev)
-{
- struct qcom_pcie *pcie = platform_get_drvdata(pdev);
-
- qcom_ep_reset_assert(pcie);
- phy_power_off(pcie->phy);
- phy_exit(pcie->phy);
- pcie->ops->deinit(pcie);
-
- return 0;
-}
-
static const struct of_device_id qcom_pcie_match[] = {
{ .compatible = "qcom,pcie-ipq8064", .data = &ops_v0 },
{ .compatible = "qcom,pcie-apq8064", .data = &ops_v0 },
{ .compatible = "qcom,pcie-apq8084", .data = &ops_v1 },
{ }
};
-MODULE_DEVICE_TABLE(of, qcom_pcie_match);
static struct platform_driver qcom_pcie_driver = {
.probe = qcom_pcie_probe,
- .remove = qcom_pcie_remove,
.driver = {
.name = "qcom-pcie",
+ .suppress_bind_attrs = true,
.of_match_table = qcom_pcie_match,
},
};
-
-module_platform_driver(qcom_pcie_driver);
-
-MODULE_AUTHOR("Stanimir Varbanov <svarbanov@mm-sol.com>");
-MODULE_DESCRIPTION("Qualcomm PCIe root complex driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(qcom_pcie_driver);
--
2.8.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 6/9] PCI: PCIe xilinx: make host code explicitly non-modular
2016-08-24 20:57 [PATCH 0/9] PCI: final demodularization of non-modular code Paul Gortmaker
` (4 preceding siblings ...)
2016-08-24 20:57 ` [PATCH 5/9] PCI: PCIe qcom: " Paul Gortmaker
@ 2016-08-24 20:57 ` Paul Gortmaker
2016-08-24 20:57 ` [PATCH 7/9] PCI: PCIe xilinx-nwl: " Paul Gortmaker
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Paul Gortmaker @ 2016-08-24 20:57 UTC (permalink / raw)
To: linux-kernel
Cc: Paul Gortmaker, Bjorn Helgaas, Michal Simek,
Sören Brinkmann, linux-pci
The Kconfig currently controlling compilation of this code is:
drivers/pci/host/Kconfig:config PCIE_XILINX
drivers/pci/host/Kconfig: bool "Xilinx AXI PCIe host bridge support"
...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. This
makes xilinx_pcie_free_irq_domain orphaned so we remove it too.
We don't have to worry about disallowing a driver unbind, since this
driver already does that.
Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.
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: Bjorn Helgaas <bhelgaas@google.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/pci/host/pcie-xilinx.c | 53 ++----------------------------------------
1 file changed, 2 insertions(+), 51 deletions(-)
diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
index a30e01639557..7b7dbd22bccc 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -18,7 +18,7 @@
#include <linux/irq.h>
#include <linux/irqdomain.h>
#include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/msi.h>
#include <linux/of_address.h>
#include <linux/of_pci.h>
@@ -506,35 +506,6 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
}
/**
- * xilinx_pcie_free_irq_domain - Free IRQ domain
- * @port: PCIe port information
- */
-static void xilinx_pcie_free_irq_domain(struct xilinx_pcie_port *port)
-{
- int i;
- u32 irq, num_irqs;
-
- /* Free IRQ Domain */
- if (IS_ENABLED(CONFIG_PCI_MSI)) {
-
- free_pages(port->msi_pages, 0);
-
- num_irqs = XILINX_NUM_MSI_IRQS;
- } else {
- /* INTx */
- num_irqs = 4;
- }
-
- for (i = 0; i < num_irqs; i++) {
- irq = irq_find_mapping(port->irq_domain, i);
- if (irq > 0)
- irq_dispose_mapping(irq);
- }
-
- irq_domain_remove(port->irq_domain);
-}
-
-/**
* xilinx_pcie_init_irq_domain - Initialize IRQ domain
* @port: PCIe port information
*
@@ -724,21 +695,6 @@ error:
return err;
}
-/**
- * xilinx_pcie_remove - Remove function
- * @pdev: Platform device pointer
- *
- * Return: '0' always
- */
-static int xilinx_pcie_remove(struct platform_device *pdev)
-{
- struct xilinx_pcie_port *port = platform_get_drvdata(pdev);
-
- xilinx_pcie_free_irq_domain(port);
-
- return 0;
-}
-
static struct of_device_id xilinx_pcie_of_match[] = {
{ .compatible = "xlnx,axi-pcie-host-1.00.a", },
{}
@@ -751,10 +707,5 @@ static struct platform_driver xilinx_pcie_driver = {
.suppress_bind_attrs = true,
},
.probe = xilinx_pcie_probe,
- .remove = xilinx_pcie_remove,
};
-module_platform_driver(xilinx_pcie_driver);
-
-MODULE_AUTHOR("Xilinx Inc");
-MODULE_DESCRIPTION("Xilinx AXI PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(xilinx_pcie_driver);
--
2.8.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 7/9] PCI: PCIe xilinx-nwl: make host code explicitly non-modular
2016-08-24 20:57 [PATCH 0/9] PCI: final demodularization of non-modular code Paul Gortmaker
` (5 preceding siblings ...)
2016-08-24 20:57 ` [PATCH 6/9] PCI: PCIe xilinx: " Paul Gortmaker
@ 2016-08-24 20:57 ` Paul Gortmaker
2016-08-24 20:57 ` [PATCH 8/9] PCI: hotplug_core: make it " Paul Gortmaker
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Paul Gortmaker @ 2016-08-24 20:57 UTC (permalink / raw)
To: linux-kernel
Cc: Paul Gortmaker, Bjorn Helgaas, Michal Simek,
Sören Brinkmann, Marc Zyngier, Bharat Kumar Gogada,
linux-pci
The Kconfig currently controlling compilation of this code is:
drivers/pci/host/Kconfig:config PCIE_XILINX_NWL
drivers/pci/host/Kconfig: bool "NWL PCIe Core"
...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. Several functions only used by the
remove function are also deleted here.
Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.
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: Bjorn Helgaas <bhelgaas@google.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/pci/host/pcie-xilinx-nwl.c | 53 +++-----------------------------------
1 file changed, 3 insertions(+), 50 deletions(-)
diff --git a/drivers/pci/host/pcie-xilinx-nwl.c b/drivers/pci/host/pcie-xilinx-nwl.c
index 0b597d9190b4..df7fb8b69658 100644
--- a/drivers/pci/host/pcie-xilinx-nwl.c
+++ b/drivers/pci/host/pcie-xilinx-nwl.c
@@ -15,7 +15,7 @@
#include <linux/irq.h>
#include <linux/irqdomain.h>
#include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/msi.h>
#include <linux/of_address.h>
#include <linux/of_pci.h>
@@ -459,40 +459,6 @@ static const struct irq_domain_ops dev_msi_domain_ops = {
.free = nwl_irq_domain_free,
};
-static void nwl_msi_free_irq_domain(struct nwl_pcie *pcie)
-{
- struct nwl_msi *msi = &pcie->msi;
-
- if (msi->irq_msi0)
- irq_set_chained_handler_and_data(msi->irq_msi0, NULL, NULL);
- if (msi->irq_msi1)
- irq_set_chained_handler_and_data(msi->irq_msi1, NULL, NULL);
-
- if (msi->msi_domain)
- irq_domain_remove(msi->msi_domain);
- if (msi->dev_domain)
- irq_domain_remove(msi->dev_domain);
-
- kfree(msi->bitmap);
- msi->bitmap = NULL;
-}
-
-static void nwl_pcie_free_irq_domain(struct nwl_pcie *pcie)
-{
- int i;
- u32 irq;
-
- for (i = 0; i < INTX_NUM; i++) {
- irq = irq_find_mapping(pcie->legacy_irq_domain, i + 1);
- if (irq > 0)
- irq_dispose_mapping(irq);
- }
- if (pcie->legacy_irq_domain)
- irq_domain_remove(pcie->legacy_irq_domain);
-
- nwl_msi_free_irq_domain(pcie);
-}
-
static int nwl_pcie_init_msi_irq_domain(struct nwl_pcie *pcie)
{
#ifdef CONFIG_PCI_MSI
@@ -867,25 +833,12 @@ error:
return err;
}
-static int nwl_pcie_remove(struct platform_device *pdev)
-{
- struct nwl_pcie *pcie = platform_get_drvdata(pdev);
-
- nwl_pcie_free_irq_domain(pcie);
- platform_set_drvdata(pdev, NULL);
- return 0;
-}
-
static struct platform_driver nwl_pcie_driver = {
.driver = {
.name = "nwl-pcie",
+ .suppress_bind_attrs = true,
.of_match_table = nwl_pcie_of_match,
},
.probe = nwl_pcie_probe,
- .remove = nwl_pcie_remove,
};
-module_platform_driver(nwl_pcie_driver);
-
-MODULE_AUTHOR("Xilinx, Inc");
-MODULE_DESCRIPTION("NWL PCIe driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(nwl_pcie_driver);
--
2.8.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 8/9] PCI: hotplug_core: make it explicitly non-modular
2016-08-24 20:57 [PATCH 0/9] PCI: final demodularization of non-modular code Paul Gortmaker
` (6 preceding siblings ...)
2016-08-24 20:57 ` [PATCH 7/9] PCI: PCIe xilinx-nwl: " Paul Gortmaker
@ 2016-08-24 20:57 ` Paul Gortmaker
2016-08-24 20:57 ` [PATCH 9/9] PCI: hotplug: make PCIe core code " Paul Gortmaker
2016-08-24 22:34 ` [PATCH 0/9] PCI: final demodularization of non-modular code Bjorn Helgaas
9 siblings, 0 replies; 11+ messages in thread
From: Paul Gortmaker @ 2016-08-24 20:57 UTC (permalink / raw)
To: linux-kernel
Cc: Paul Gortmaker, Scott Murray, kristen.c.accardi, Bjorn Helgaas,
linux-pci
The Makefile bits currently controlling compilation of this code are:
obj-$(CONFIG_HOTPLUG_PCI) += pci_hotplug.o
[...]
pci_hotplug-objs := pci_hotplug_core.o
and the Kconfig is:
drivers/pci/hotplug/Kconfig:menuconfig HOTPLUG_PCI
drivers/pci/hotplug/Kconfig: bool "Support for PCI Hotplug"
...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.
This makes an exit function in cpci_hotplug_core.c orphaned, so we
remove it here at the same time.
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 would delete module.h and just keep the moduleparam.h include (since
the file does use module_param), but there is a try_module_get and
module_put pairing that prevents us from doing that.
We also delete the MODULE_LICENSE tag etc since all that information
is already contained higher up in the file.
Cc: Scott Murray <scott@spiteful.org>
Cc: kristen.c.accardi@intel.com
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/pci/hotplug/cpci_hotplug.h | 2 --
drivers/pci/hotplug/cpci_hotplug_core.c | 10 ----------
drivers/pci/hotplug/pci_hotplug_core.c | 18 ++++++------------
3 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h
index 555bcde3b196..60e66e027ebc 100644
--- a/drivers/pci/hotplug/cpci_hotplug.h
+++ b/drivers/pci/hotplug/cpci_hotplug.h
@@ -101,10 +101,8 @@ int cpci_unconfigure_slot(struct slot *slot);
#ifdef CONFIG_HOTPLUG_PCI_CPCI
int cpci_hotplug_init(int debug);
-void cpci_hotplug_exit(void);
#else
static inline int cpci_hotplug_init(int debug) { return 0; }
-static inline void cpci_hotplug_exit(void) { }
#endif
#endif /* _CPCI_HOTPLUG_H */
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c
index 7d3866c47312..7ec8a8f72c69 100644
--- a/drivers/pci/hotplug/cpci_hotplug_core.c
+++ b/drivers/pci/hotplug/cpci_hotplug_core.c
@@ -719,13 +719,3 @@ cpci_hotplug_init(int debug)
cpci_debug = debug;
return 0;
}
-
-void __exit
-cpci_hotplug_exit(void)
-{
- /*
- * Clean everything up.
- */
- cpci_hp_stop();
- cpci_hp_unregister_controller(controller);
-}
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
index 9acd1997c6fe..fea0b8b33589 100644
--- a/drivers/pci/hotplug/pci_hotplug_core.c
+++ b/drivers/pci/hotplug/pci_hotplug_core.c
@@ -25,7 +25,7 @@
*
*/
-#include <linux/module.h>
+#include <linux/module.h> /* try_module_get & module_put */
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/types.h>
@@ -537,17 +537,11 @@ static int __init pci_hotplug_init(void)
info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
return result;
}
+device_initcall(pci_hotplug_init);
-static void __exit pci_hotplug_exit(void)
-{
- cpci_hotplug_exit();
-}
-
-module_init(pci_hotplug_init);
-module_exit(pci_hotplug_exit);
-
-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(debug, bool, 0644);
MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
--
2.8.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 9/9] PCI: hotplug: make PCIe core code explicitly non-modular
2016-08-24 20:57 [PATCH 0/9] PCI: final demodularization of non-modular code Paul Gortmaker
` (7 preceding siblings ...)
2016-08-24 20:57 ` [PATCH 8/9] PCI: hotplug_core: make it " Paul Gortmaker
@ 2016-08-24 20:57 ` Paul Gortmaker
2016-08-24 22:34 ` [PATCH 0/9] PCI: final demodularization of non-modular code Bjorn Helgaas
9 siblings, 0 replies; 11+ messages in thread
From: Paul Gortmaker @ 2016-08-24 20:57 UTC (permalink / raw)
To: linux-kernel; +Cc: Paul Gortmaker, Bjorn Helgaas, kristen.c.accardi, linux-pci
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 <bhelgaas@google.com>
Cc: kristen.c.accardi@intel.com
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
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 <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/slab.h>
@@ -47,10 +46,10 @@ static bool pciehp_force;
#define DRIVER_AUTHOR "Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>, Dely Sy <dely.l.sy@intel.com>"
#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);
--
2.8.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 0/9] PCI: final demodularization of non-modular code
2016-08-24 20:57 [PATCH 0/9] PCI: final demodularization of non-modular code Paul Gortmaker
` (8 preceding siblings ...)
2016-08-24 20:57 ` [PATCH 9/9] PCI: hotplug: make PCIe core code " Paul Gortmaker
@ 2016-08-24 22:34 ` Bjorn Helgaas
9 siblings, 0 replies; 11+ messages in thread
From: Bjorn Helgaas @ 2016-08-24 22:34 UTC (permalink / raw)
To: Paul Gortmaker
Cc: linux-kernel, Bharat Kumar Gogada, Bjorn Helgaas, Keith Busch,
Kishon Vijay Abraham I, kristen.c.accardi, Marc Zyngier,
Michal Simek, Mika Westerberg, Scott Murray,
Sören Brinkmann, Stanimir Varbanov, Tom Long Nguyen,
linux-omap, linux-pci
On Wed, Aug 24, 2016 at 04:57:43PM -0400, Paul Gortmaker wrote:
> This final (assuming more new instances don't leak back in) series
> ensures all the PCI code out there that remains using module.h is
> actually modular or containing some use of modular infrastructure.
>
> These last commits are slightly more involved than some of the
> earlier ones since we are actually removing orphaned __exit functions
> and some ".remove" functions as well. So we can't claim binary
> equivalence here, but the overall runtime should remain unchanged.
>
> To that end, we have remained with the existing initcall levels
> even though some of the hotplug infrastructural ones might make
> better sense to be listed as subsys_initcall or similar.
>
> Build tested with allmodconfig on all the major architectures.
>
> Paul.
> ---
>
> Cc: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Keith Busch <keith.busch@intel.com>
> Cc: Kishon Vijay Abraham I <kishon@ti.com>
> Cc: kristen.c.accardi@intel.com
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: Michal Simek <michal.simek@xilinx.com>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> Cc: Scott Murray <scott@spiteful.org>
> Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
> Cc: Stanimir Varbanov <svarbanov@mm-sol.com>
> Cc: Tom Long Nguyen <tom.l.nguyen@intel.com>
> Cc: linux-omap@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
>
> Paul Gortmaker (9):
> PCI: PCIe dpc: make it explicitly non-modular
> PCI: PCIe pme: make it explicitly non-modular
> PCI: PCIe aerdrv: make it explicitly non-modular
> PCI: dra7xx: make host code explicitly non-modular
> PCI: PCIe qcom: make host code explicitly non-modular
> PCI: PCIe xilinx: make host code explicitly non-modular
> PCI: PCIe xilinx-nwl: make host code explicitly non-modular
> PCI: hotplug_core: make it explicitly non-modular
> PCI: hotplug: make PCIe core code explicitly non-modular
>
> drivers/pci/host/pci-dra7xx.c | 31 ++-----------------
> drivers/pci/host/pcie-qcom.c | 28 +++++------------
> drivers/pci/host/pcie-xilinx-nwl.c | 53 ++-------------------------------
> drivers/pci/host/pcie-xilinx.c | 53 ++-------------------------------
> drivers/pci/hotplug/cpci_hotplug.h | 2 --
> drivers/pci/hotplug/cpci_hotplug_core.c | 10 -------
> drivers/pci/hotplug/pci_hotplug_core.c | 18 ++++-------
> drivers/pci/hotplug/pciehp_core.c | 20 ++++---------
> drivers/pci/pcie/aer/aerdrv.c | 18 +----------
> drivers/pci/pcie/pcie-dpc.c | 18 +++--------
> drivers/pci/pcie/pme.c | 16 +---------
> 11 files changed, 32 insertions(+), 235 deletions(-)
Applied to pci/demodularize for v4.9, thanks a lot, Paul!
^ permalink raw reply [flat|nested] 11+ messages in thread