Skip to contentSkip to conversation

PCI: trivial demodularization of builtin code

PATCH Applied Paul Gortmaker 8 participants 26 messages Jul 2, 2016 – Jul 22, 2016 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover PCI: trivial demodularization of builtin code

Firstly, this group of commits was chosen for the fact that they don't change anything even at a binary object file level ; they just replace module_platform_driver with builtin_platform_driver, and remove some MODULE_<blah> tags that are no-ops in code. So the regression risk is zero here.

More specifically, we are doing the following to pci/host files that currently can only be built-in:

-- remove the include of module.h ; replace it with init.h as req'd

-- drop instances of MODULE_DEVICE_TABLE which is a no-op built-in.

-- replace module_platform_driver with builtin_platform_driver, which
is functionally identical once CPP has processed the source.

-- drop instances of MODULE_LICENSE, MODULE_AUTHOR, MODULE_DESCRIPTION
while ensuring the contained info is present in the file comments.

After considering the inital version of demodularization PCI host commits[1], we did consider striving for tristate[2] on another subset of PCI host files in order to keep bzImage sizes lower on multi-platform builds, but that proved to have technical challenges well outside the scope of what we are trying to achieve here, given PCI is infrastructure code and not a case of simple endpoint drivers.

In the meantime more new code copies the existing examples of bool Kconfig using modular references; further expanding the problem space. So we are just going to proceed with the demodularization as originally planned. Nothing removed here is rocket science, and can easily be restored if someone has the hardware to test on and the desire to expand functionality into the tristate realm.

A more complete description of why we are doing this can be found in the original posting[1] for those that haven't seen it yet.

This represents just over 1/2 the PCI drivers that have their Kconfig as bool but needlessly use modular references. The remainder do not deliver exact binary equivalence, since they delete unused __exit functions and/or unused ".remove" functions. So they are more appropriate for submission earlier in the next development window.

Build tested for allmodconfig on several arch, including ARM and ARM-64 on the most recent linux-next baseline.

Paul.

[1] https://lkml.kernel.org/r/[email protected]
[2] https://lkml.kernel.org/r/[email protected]

---

[vs v1 in [1] above, I tweaked the subjects slightly to match the
format used by most PCI commits, i.e drop the "driver/" prefix. ]

Cc Alexandre Courbot <[email protected]>
Cc Bjorn Helgaas <[email protected]>
Cc David Daney <[email protected]>
Cc Gabriele Paoloni <[email protected]>
Cc Jason Cooper <[email protected]>
Cc Jesper Nilsson <[email protected]>
Cc Jingoo Han <[email protected]>
Cc Joao Pinto <[email protected]>
Cc Minghuan Lian <[email protected]>
Cc Mingkai Hu <[email protected]>
Cc Murali Karicheri <[email protected]>
Cc Niklas Cassel <[email protected]>
Cc Phil Edworthy <[email protected]>
Cc Pratyush Anand <[email protected]>
Cc Roy Zang <[email protected]>
Cc Simon Horman <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Tanmay Inamdar <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Valentine Barshak <[email protected]>
Cc Will Deacon <[email protected]>
Cc Zhou Wang <[email protected]>

Paul Gortmaker (14):
PCI: armada8k: make it explicitly non-modular
PCI: artpec6: make it explicitly non-modular
PCI: designware-plat: make it explicitly non-modular
PCI: generic: make it explicitly non-modular
PCI: hisi: make it explicitly non-modular
PCI: keystone: make it explicitly non-modular
PCI: layerscape: make it explicitly non-modular
PCI: mvebu: make it explicitly non-modular
PCI: rcar: make it explicitly non-modular
PCI: rcar-gen2: make it explicitly non-modular
PCI: tegra: make it explicitly non-modular
PCI: thunder-ecam: make it explicitly non-modular
PCI: thunder-pem: make it explicitly non-modular
PCI: xgene: make it explicitly non-modular

 drivers/pci/host/pci-host-generic.c     | 10 ++--------
 drivers/pci/host/pci-keystone.c         | 10 ++--------
 drivers/pci/host/pci-layerscape.c       | 10 ++--------
 drivers/pci/host/pci-mvebu.c            | 11 ++++-------
 drivers/pci/host/pci-rcar-gen2.c        | 12 +++---------
 drivers/pci/host/pci-tegra.c            | 11 ++++-------
 drivers/pci/host/pci-thunder-ecam.c     |  8 ++------
 drivers/pci/host/pci-thunder-pem.c      |  8 ++------
 drivers/pci/host/pci-xgene.c            |  8 ++------
 drivers/pci/host/pcie-armada8k.c        | 14 +++++---------
 drivers/pci/host/pcie-artpec6.c         | 10 ++--------
 drivers/pci/host/pcie-designware-plat.c | 10 ++--------
 drivers/pci/host/pcie-hisi.c            | 13 ++-----------
 drivers/pci/host/pcie-rcar.c            | 11 ++++-------
 14 files changed, 38 insertions(+), 108 deletions(-)
Signature · 1 line
2.8.4
#1 lore raw

PATCH 1/14 PCI: armada8k: make it explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCIE_ARMADA_8K
drivers/pci/host/Kconfig: bool "Marvell Armada-8K PCIe controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

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.

---
 drivers/pci/host/pcie-armada8k.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/pci/host/pcie-armada8k.c +5 -9
index 55723567b5d4..0f4f570068e3 100644
@@ -5,6 +5,9 @@
  *
  * Copyright (C) 2016 Marvell Technology Group Ltd.
  *
+ * Author: Yehuda Yitshak <[email protected]>
+ * Author: Shadi Ammouri <[email protected]>
+ *
  * This file is licensed under the terms of the GNU General Public
  * License version 2. This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
@@ -14,7 +17,7 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/pci.h>
 #include <linux/phy/phy.h>
@@ -244,7 +247,6 @@ static const struct of_device_id armada8k_pcie_of_match[] = {
 	{ .compatible = "marvell,armada8k-pcie", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, armada8k_pcie_of_match);
 
 static struct platform_driver armada8k_pcie_driver = {
 	.probe		= armada8k_pcie_probe,
@@ -253,10 +255,4 @@ static struct platform_driver armada8k_pcie_driver = {
 		.of_match_table = of_match_ptr(armada8k_pcie_of_match),
 	},
 };
-
-module_platform_driver(armada8k_pcie_driver);
-
-MODULE_DESCRIPTION("Armada 8k PCIe host controller driver");
-MODULE_AUTHOR("Yehuda Yitshak <[email protected]>");
-MODULE_AUTHOR("Shadi Ammouri <[email protected]>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada8k_pcie_driver);
Signature · 1 line
2.8.4
#2 lore raw

PATCH 2/14 PCI: artpec6: make it explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCIE_ARTPEC6
drivers/pci/host/Kconfig: bool "Axis ARTPEC-6 PCIe controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

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.

Cc Niklas Cassel <[email protected]>
Cc Jesper Nilsson <[email protected]>
Cc Bjorn Helgaas <[email protected]>
---
 drivers/pci/host/pcie-artpec6.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/pci/host/pcie-artpec6.c +2 -8
index be54fad4698b..73d4e8cb020b 100644
@@ -10,7 +10,7 @@
 
 #include <linux/delay.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/platform_device.h>
 #include <linux/resource.h>
@@ -267,7 +267,6 @@ static const struct of_device_id artpec6_pcie_of_match[] = {
 	{ .compatible = "axis,artpec6-pcie", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, artpec6_pcie_of_match);
 
 static struct platform_driver artpec6_pcie_driver = {
 	.probe = artpec6_pcie_probe,
@@ -276,9 +275,4 @@ static struct platform_driver artpec6_pcie_driver = {
 		.of_match_table = artpec6_pcie_of_match,
 	},
 };
-
-module_platform_driver(artpec6_pcie_driver);
-
-MODULE_AUTHOR("Niklas Cassel <[email protected]>");
-MODULE_DESCRIPTION("Axis ARTPEC-6 PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(artpec6_pcie_driver);
Signature · 1 line
2.8.4
#3 lore raw

PATCH 3/14 PCI: designware-plat: make it explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCIE_DW_PLAT
drivers/pci/host/Kconfig: bool "Platform bus based DesignWare PCIe Controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

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 Jingoo Han <[email protected]>
Cc Pratyush Anand <[email protected]>
Cc Joao Pinto <[email protected]>
Cc Bjorn Helgaas <[email protected]>
---
 drivers/pci/host/pcie-designware-plat.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/pci/host/pcie-designware-plat.c +2 -8
index b3500994d08a..c8079dc81c10 100644
@@ -14,7 +14,7 @@
 #include <linux/gpio.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_gpio.h>
 #include <linux/pci.h>
 #include <linux/platform_device.h>
@@ -121,7 +121,6 @@ static const struct of_device_id dw_plat_pcie_of_match[] = {
 	{ .compatible = "snps,dw-pcie", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, dw_plat_pcie_of_match);
 
 static struct platform_driver dw_plat_pcie_driver = {
 	.driver = {
@@ -130,9 +129,4 @@ static struct platform_driver dw_plat_pcie_driver = {
 	},
 	.probe = dw_plat_pcie_probe,
 };
-
-module_platform_driver(dw_plat_pcie_driver);
-
-MODULE_AUTHOR("Joao Pinto <[email protected]>");
-MODULE_DESCRIPTION("Synopsys PCIe host controller glue platform driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(dw_plat_pcie_driver);
Signature · 1 line
2.8.4
Acked-by on v1 3/14
#4 lore raw

Re: [PATCH 03/14] PCI: designware-plat: make it explicitly non-modular

Hi Paul,

Quoted 5 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCIE_DW_PLAT
drivers/pci/host/Kconfig: bool "Platform bus based DesignWare PCIe Controller"

(snip...)

Quoted 33 lines
Cc Jingoo Han <[email protected]>
Cc Pratyush Anand <[email protected]>
Cc Joao Pinto <[email protected]>
Cc Bjorn Helgaas <[email protected]>
---
 drivers/pci/host/pcie-designware-plat.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/pci/host/pcie-designware-plat.c +1 -2
index b3500994d08a..c8079dc81c10 100644
@@ -14,7 +14,7 @@
 #include <linux/gpio.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_gpio.h>
 #include <linux/pci.h>
 #include <linux/platform_device.h>
@@ -121,7 +121,6 @@ static const struct of_device_id dw_plat_pcie_of_match[] = {
 	{ .compatible = "snps,dw-pcie", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, dw_plat_pcie_of_match);
 
 static struct platform_driver dw_plat_pcie_driver = {
 	.driver = {

drivers/pci/host/pcie-designware-plat.c static struct platform_driver dw_plat_pcie_driver = { · line 132

Quoted 10 lines
drivers/pci/host/pcie-designware-plat.c +1 -6
@@ -130,9 +129,4 @@ static struct platform_driver dw_plat_pcie_driver = {
 	},
 	.probe = dw_plat_pcie_probe,
 };
-
-module_platform_driver(dw_plat_pcie_driver);
-
-MODULE_AUTHOR("Joao Pinto <[email protected]>");
-MODULE_DESCRIPTION("Synopsys PCIe host controller glue platform driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(dw_plat_pcie_driver);

Makes totally sense! Thanks!

#5 lore raw

PATCH 4/14 PCI: generic: make it explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_HOST_GENERIC
drivers/pci/host/Kconfig: bool "Generic PCI host controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

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.

---
 drivers/pci/host/pci-host-generic.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/pci/host/pci-host-generic.c +2 -8
index f0ca6de0d87e..c05ea9d72f69 100644
@@ -20,7 +20,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
 #include <linux/pci-ecam.h>
@@ -45,8 +45,6 @@ static const struct of_device_id gen_pci_of_match[] = {
 	{ },
 };
 
-MODULE_DEVICE_TABLE(of, gen_pci_of_match);
-
 static int gen_pci_probe(struct platform_device *pdev)
 {
 	const struct of_device_id *of_id;
@@ -65,8 +63,4 @@ static struct platform_driver gen_pci_driver = {
 	},
 	.probe = gen_pci_probe,
 };
-module_platform_driver(gen_pci_driver);
-
-MODULE_DESCRIPTION("Generic PCI host driver");
-MODULE_AUTHOR("Will Deacon <[email protected]>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(gen_pci_driver);
Signature · 1 line
2.8.4
#6 lore raw

Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular

Quoted 10 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_HOST_GENERIC
drivers/pci/host/Kconfig: bool "Generic PCI host controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

Quoted 8 lines

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.

Ideally, we'd simply fix this to build as a module, but it's not clear how to do that now that the ecam accessors have been split out into their own file. A liberal sprinkling of EXPORT_SYMBOL might work, but it's a bit grotty.

David, Jayachandran -- do you have any desire to build your PCI host controller drivers as modules?

Will

#7 lore raw

Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular

Quoted 20 lines · Will Deacon
Quoted 10 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_HOST_GENERIC
drivers/pci/host/Kconfig: bool "Generic PCI host controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

Quoted 8 lines

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.

Quoted 7 lines

Ideally, we'd simply fix this to build as a module, but it's not clear how to do that now that the ecam accessors have been split out into their own file. A liberal sprinkling of EXPORT_SYMBOL might work, but it's a bit grotty.

David, Jayachandran -- do you have any desire to build your PCI host controller drivers as modules?

I can only speak to the Cavium case.

The system is not usable without PCI, so there is no advantage to making the PCI host drivers modular. At this point I don't see any reason to expend effort making it work as a module.

David.

Quoted 3 lines

Will

#8 lore raw

Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular

Quoted 30 lines · David Daney
Quoted 28 lines · Will Deacon
Quoted 11 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_HOST_GENERIC
drivers/pci/host/Kconfig: bool "Generic PCI host controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

Quoted 8 lines

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.

Ideally, we'd simply fix this to build as a module, but it's not clear how to do that now that the ecam accessors have been split out into their own file. A liberal sprinkling of EXPORT_SYMBOL might work, but it's a bit grotty.

Quoted 8 lines
Quoted 2 lines

David, Jayachandran -- do you have any desire to build your PCI host controller drivers as modules?

I can only speak to the Cavium case.

The system is not usable without PCI, so there is no advantage to making the PCI host drivers modular. At this point I don't see any reason to expend effort making it work as a module.

Broadcom's case is also similar - pci-host-generic would to be built-in when booting with device tree, or it would be unnecessary when booting with ACPI. We don't have a scenario in which having it as a module would be useful.

JC

Acked-by on v1 4/14
#9 lore raw

Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular

In reply to Paul Gortmaker
Quoted 19 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_HOST_GENERIC
drivers/pci/host/Kconfig: bool "Generic PCI host controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

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.

Quoted 7 lines
---
 drivers/pci/host/pci-host-generic.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Given that nobody seems to need this as a module and it's not straightforward to enable that:

I assume you've done something similar for
drivers/pci/host/pci-host-common.c?

Will

#10 lore raw

Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular

Quoted 28 lines · [Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular] On 06/07/2016…
Quoted 19 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_HOST_GENERIC
drivers/pci/host/Kconfig: bool "Generic PCI host controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

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.

Quoted 7 lines
---
 drivers/pci/host/pci-host-generic.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
Quoted 7 lines

Given that nobody seems to need this as a module and it's not straightforward to enable that:

I assume you've done something similar for
drivers/pci/host/pci-host-common.c?

Not yet -- that one escaped my radar because it didn't have module_init or MODULE_DEVICE_TABLE in it; it just has MODULE_AUTHOR etc. I'll add that fix to my queue and update my audit to hide the MODULE_AUTHOR tags when compiling for !MODULE.

Thanks,
Paul.
--

Quoted 2 lines

Will

#11 lore raw

PATCH 5/14 PCI: hisi: make it explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

host/Kconfig:config PCI_HISI
host/Kconfig: bool "HiSilicon Hip05 and Hip06 SoCs PCIe controllers"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

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 Zhou Wang <[email protected]>
Cc Dacai Zhu <[email protected]>
Cc Gabriele Paoloni <[email protected]>
Cc Bjorn Helgaas <[email protected]>
---
 drivers/pci/host/pcie-hisi.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
drivers/pci/host/pcie-hisi.c +2 -11
index 3e98d4edae2d..7ee9dfcc45fb 100644
@@ -12,7 +12,7 @@
  * published by the Free Software Foundation.
  */
 #include <linux/interrupt.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/mfd/syscon.h>
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
@@ -235,9 +235,6 @@ static const struct of_device_id hisi_pcie_of_match[] = {
 	{},
 };
 
-
-MODULE_DEVICE_TABLE(of, hisi_pcie_of_match);
-
 static struct platform_driver hisi_pcie_driver = {
 	.probe  = hisi_pcie_probe,
 	.driver = {
@@ -245,10 +242,4 @@ static struct platform_driver hisi_pcie_driver = {
 		   .of_match_table = hisi_pcie_of_match,
 	},
 };
-
-module_platform_driver(hisi_pcie_driver);
-
-MODULE_AUTHOR("Zhou Wang <[email protected]>");
-MODULE_AUTHOR("Dacai Zhu <[email protected]>");
-MODULE_AUTHOR("Gabriele Paoloni <[email protected]>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(hisi_pcie_driver);
Signature · 1 line
2.8.4
#12 lore raw

PATCH 6/14 PCI: keystone: make it explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_KEYSTONE
drivers/pci/host/Kconfig: bool "TI Keystone PCIe controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple instances of modular code usage, so that when reading the driver there is no doubt it is builtin-only.

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.

---
 drivers/pci/host/pci-keystone.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/pci/host/pci-keystone.c +2 -8
index 6b8301ef21ca..8ba28834d470 100644
@@ -17,7 +17,7 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/irqdomain.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/msi.h>
 #include <linux/of_irq.h>
 #include <linux/of.h>
@@ -360,7 +360,6 @@ static const struct of_device_id ks_pcie_of_match[] = {
 	},
 	{ },
 };
-MODULE_DEVICE_TABLE(of, ks_pcie_of_match);
 
 static int __exit ks_pcie_remove(struct platform_device *pdev)
 {
@@ -439,9 +438,4 @@ static struct platform_driver ks_pcie_driver __refdata = {
 		.of_match_table = of_match_ptr(ks_pcie_of_match),
 	},
 };
-
-module_platform_driver(ks_pcie_driver);
-
-MODULE_AUTHOR("Murali Karicheri <[email protected]>");
-MODULE_DESCRIPTION("Keystone PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(ks_pcie_driver);
Signature · 1 line
2.8.4
Tested-by on v1 6/14
#13 lore raw

Re: [PATCH 06/14] PCI: keystone: make it explicitly non-modular

Quoted 50 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_KEYSTONE
drivers/pci/host/Kconfig: bool "TI Keystone PCIe controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple instances of modular code usage, so that when reading the driver there is no doubt it is builtin-only.

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.

---
 drivers/pci/host/pci-keystone.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/pci/host/pci-keystone.c +1 -2
index 6b8301ef21ca..8ba28834d470 100644
@@ -17,7 +17,7 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/irqdomain.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/msi.h>
 #include <linux/of_irq.h>
 #include <linux/of.h>
@@ -360,7 +360,6 @@ static const struct of_device_id ks_pcie_of_match[] = {
 	},
 	{ },
 };
-MODULE_DEVICE_TABLE(of, ks_pcie_of_match);
 
 static int __exit ks_pcie_remove(struct platform_device *pdev)
 {

drivers/pci/host/pci-keystone.c static struct platform_driver ks_pcie_driver __refdata = { · line 441

Quoted 10 lines
drivers/pci/host/pci-keystone.c +1 -6
@@ -439,9 +438,4 @@ static struct platform_driver ks_pcie_driver __refdata = {
 		.of_match_table = of_match_ptr(ks_pcie_of_match),
 	},
 };
-
-module_platform_driver(ks_pcie_driver);
-
-MODULE_AUTHOR("Murali Karicheri <[email protected]>");
-MODULE_DESCRIPTION("Keystone PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(ks_pcie_driver);

Paul,

It make sense as this driver can't be used as a module at present and we build it statically for Keystone.

#14 lore raw

PATCH 7/14 PCI: layerscape: make it explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_LAYERSCAPE
drivers/pci/host/Kconfig: bool "Freescale Layerscape PCIe controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple instances of modular code usage, so that when reading the driver there is no doubt it is builtin-only.

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 Minghuan Lian <[email protected]>
Cc Mingkai Hu <[email protected]>
Cc Roy Zang <[email protected]>
Cc Bjorn Helgaas <[email protected]>
---
 drivers/pci/host/pci-layerscape.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/pci/host/pci-layerscape.c +2 -8
index a21e229d95e0..114ba819277a 100644
@@ -12,7 +12,7 @@
 
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_pci.h>
 #include <linux/of_platform.h>
 #include <linux/of_irq.h>
@@ -211,7 +211,6 @@ static const struct of_device_id ls_pcie_of_match[] = {
 	{ .compatible = "fsl,ls2085a-pcie", .data = &ls2080_drvdata },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, ls_pcie_of_match);
 
 static int __init ls_add_pcie_port(struct pcie_port *pp,
 				   struct platform_device *pdev)
@@ -275,9 +274,4 @@ static struct platform_driver ls_pcie_driver = {
 		.of_match_table = ls_pcie_of_match,
 	},
 };
-
-module_platform_driver_probe(ls_pcie_driver, ls_pcie_probe);
-
-MODULE_AUTHOR("Minghuan Lian <[email protected]>");
-MODULE_DESCRIPTION("Freescale Layerscape PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver_probe(ls_pcie_driver, ls_pcie_probe);
Signature · 1 line
2.8.4
#15 lore raw

PATCH 8/14 PCI: mvebu: make it explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_MVEBU
drivers/pci/host/Kconfig: bool "Marvell EBU PCIe controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

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.

---
 drivers/pci/host/pci-mvebu.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/pci/host/pci-mvebu.c +4 -7
index 2287a4e18add..4545d204f864 100644
@@ -1,6 +1,8 @@
 /*
  * PCIe driver for Marvell Armada 370 and Armada XP SoCs
  *
+ * Module Author: Thomas Petazzoni <[email protected]>
+ *
  * This file is licensed under the terms of the GNU General Public
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
@@ -11,7 +13,7 @@
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/mbus.h>
 #include <linux/msi.h>
 #include <linux/slab.h>
@@ -1295,7 +1297,6 @@ static const struct of_device_id mvebu_pcie_of_match_table[] = {
 	{ .compatible = "marvell,kirkwood-pcie", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, mvebu_pcie_of_match_table);
 
 static const struct dev_pm_ops mvebu_pcie_pm_ops = {
 	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mvebu_pcie_suspend, mvebu_pcie_resume)
@@ -1311,8 +1312,4 @@ static struct platform_driver mvebu_pcie_driver = {
 	},
 	.probe = mvebu_pcie_probe,
 };
-module_platform_driver(mvebu_pcie_driver);
-
-MODULE_AUTHOR("Thomas Petazzoni <[email protected]>");
-MODULE_DESCRIPTION("Marvell EBU PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(mvebu_pcie_driver);
Signature · 1 line
2.8.4
#16 lore raw

PATCH 9/14 PCI: rcar: make it explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_RCAR_GEN2_PCIE
drivers/pci/host/Kconfig: bool "Renesas R-Car PCIe controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

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.

---
 drivers/pci/host/pcie-rcar.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/pci/host/pcie-rcar.c +4 -7
index 6546ca79f188..7e61ae41910e 100644
@@ -7,6 +7,8 @@
  *  arch/sh/drivers/pci/ops-sh7786.c
  *  Copyright (C) 2009 - 2011  Paul Mundt
  *
+ * Module Author: Phil Edworthy <[email protected]>
+ *
  * This file is licensed under the terms of the GNU General Public
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
@@ -18,7 +20,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_irq.h>
@@ -936,7 +938,6 @@ static const struct of_device_id rcar_pcie_of_match[] = {
 	{ .compatible = "renesas,pcie-r8a7795", .data = rcar_pcie_hw_init },
 	{},
 };
-MODULE_DEVICE_TABLE(of, rcar_pcie_of_match);
 
 static int rcar_pcie_parse_request_of_pci_ranges(struct rcar_pcie *pci)
 {
@@ -1056,8 +1057,4 @@ static struct platform_driver rcar_pcie_driver = {
 	},
 	.probe = rcar_pcie_probe,
 };
-module_platform_driver(rcar_pcie_driver);
-
-MODULE_AUTHOR("Phil Edworthy <[email protected]>");
-MODULE_DESCRIPTION("Renesas R-Car PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(rcar_pcie_driver);
Signature · 1 line
2.8.4
#17 lore raw

PATCH 10/14 PCI: rcar-gen2: make it explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_RCAR_GEN2
drivers/pci/host/Kconfig: bool "Renesas R-Car Gen2 Internal PCI controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as builtin_platform_driver() 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 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.

---
 drivers/pci/host/pci-rcar-gen2.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/pci/host/pci-rcar-gen2.c +3 -9
index e8f5ac84b2c6..77a451cd3e32 100644
@@ -4,6 +4,8 @@
  * Copyright (C) 2013 Renesas Solutions Corp.
  * Copyright (C) 2013 Cogent Embedded, Inc.
  *
+ * Module Author: Valentine Barshak <[email protected]>
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
@@ -14,7 +16,6 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
 #include <linux/pci.h>
@@ -432,8 +433,6 @@ static struct of_device_id rcar_pci_of_match[] = {
 	{ },
 };
 
-MODULE_DEVICE_TABLE(of, rcar_pci_of_match);
-
 static struct platform_driver rcar_pci_driver = {
 	.driver = {
 		.name = "pci-rcar-gen2",
@@ -442,9 +441,4 @@ static struct platform_driver rcar_pci_driver = {
 	},
 	.probe = rcar_pci_probe,
 };
-
-module_platform_driver(rcar_pci_driver);
-
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("Renesas R-Car Gen2 internal PCI");
-MODULE_AUTHOR("Valentine Barshak <[email protected]>");
+builtin_platform_driver(rcar_pci_driver);
Signature · 1 line
2.8.4
#18 lore raw

PATCH 11/14 PCI: tegra: make it explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_TEGRA
drivers/pci/host/Kconfig: bool "NVIDIA Tegra PCIe controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

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 Thierry Reding <[email protected]>
Cc Bjorn Helgaas <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Alexandre Courbot <[email protected]>
---
 drivers/pci/host/pci-tegra.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/pci/host/pci-tegra.c +4 -7
index 013d5488f9f8..c9a8eb252f50 100644
@@ -9,6 +9,8 @@
  *
  * Bits taken from arch/arm/mach-dove/pcie.c
  *
+ * Author: Thierry Reding <[email protected]>
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -32,7 +34,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>
@@ -2088,7 +2090,6 @@ static const struct of_device_id tegra_pcie_of_match[] = {
 	{ .compatible = "nvidia,tegra20-pcie", .data = &tegra20_pcie_data },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, tegra_pcie_of_match);
 
 static void *tegra_pcie_ports_seq_start(struct seq_file *s, loff_t *pos)
 {
@@ -2277,8 +2278,4 @@ static struct platform_driver tegra_pcie_driver = {
 	},
 	.probe = tegra_pcie_probe,
 };
-module_platform_driver(tegra_pcie_driver);
-
-MODULE_AUTHOR("Thierry Reding <[email protected]>");
-MODULE_DESCRIPTION("NVIDIA Tegra PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(tegra_pcie_driver);
Signature · 1 line
2.8.4
#19 lore raw

PATCH 12/14 PCI: thunder-ecam: make it explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_HOST_THUNDER_ECAM
drivers/pci/host/Kconfig: bool "Cavium Thunder ECAM controller to on-chip devices on pass-1.x silicon"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

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.

---
 drivers/pci/host/pci-thunder-ecam.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/pci/host/pci-thunder-ecam.c +2 -6
index a9fc1c9105fd..d50a3dc2d8db 100644
@@ -7,7 +7,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/ioport.h>
 #include <linux/of_pci.h>
 #include <linux/of.h>
@@ -359,7 +359,6 @@ static const struct of_device_id thunder_ecam_of_match[] = {
 	{ .compatible = "cavium,pci-host-thunder-ecam" },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, thunder_ecam_of_match);
 
 static int thunder_ecam_probe(struct platform_device *pdev)
 {
@@ -373,7 +372,4 @@ static struct platform_driver thunder_ecam_driver = {
 	},
 	.probe = thunder_ecam_probe,
 };
-module_platform_driver(thunder_ecam_driver);
-
-MODULE_DESCRIPTION("Thunder ECAM PCI host driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(thunder_ecam_driver);
Signature · 1 line
2.8.4
#20 lore raw

PATCH 13/14 PCI: thunder-pem: make it explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_HOST_THUNDER_PEM
drivers/pci/host/Kconfig: bool "Cavium Thunder PCIe controller to off-chip devices"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

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.

---
 drivers/pci/host/pci-thunder-pem.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/pci/host/pci-thunder-pem.c +2 -6
index 91f6fc68d374..6abaf80ffb39 100644
@@ -15,7 +15,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
 #include <linux/pci-ecam.h>
@@ -346,7 +346,6 @@ static const struct of_device_id thunder_pem_of_match[] = {
 	{ .compatible = "cavium,pci-host-thunder-pem" },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, thunder_pem_of_match);
 
 static int thunder_pem_probe(struct platform_device *pdev)
 {
@@ -360,7 +359,4 @@ static struct platform_driver thunder_pem_driver = {
 	},
 	.probe = thunder_pem_probe,
 };
-module_platform_driver(thunder_pem_driver);
-
-MODULE_DESCRIPTION("Thunder PEM PCIe host driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(thunder_pem_driver);
Signature · 1 line
2.8.4
#21 lore raw

PATCH 14/14 PCI: xgene: make it explicitly non-modular

In reply to Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_XGENE
drivers/pci/host/Kconfig: bool "X-Gene PCIe controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

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.

---
 drivers/pci/host/pci-xgene.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/pci/host/pci-xgene.c +2 -6
index 7eb20cc76dd3..a81273c23341 100644
@@ -21,7 +21,7 @@
 #include <linux/io.h>
 #include <linux/jiffies.h>
 #include <linux/memblock.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
@@ -579,8 +579,4 @@ static struct platform_driver xgene_pcie_driver = {
 	},
 	.probe = xgene_pcie_probe_bridge,
 };
-module_platform_driver(xgene_pcie_driver);
-
-MODULE_AUTHOR("Tanmay Inamdar <[email protected]>");
-MODULE_DESCRIPTION("APM X-Gene PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(xgene_pcie_driver);
Signature · 1 line
2.8.4

A message that is not in the archive (sent off-list or not yet received): CACoXjc=Tw2a_oCvxTmZY+7jeyyb9XvLF1yWx9FEPWekPBaAw1g@mail.gmail.com

#23 lore raw

Re: [PATCH 14/14] PCI: xgene: make it explicitly non-modular

Quoted 19 lines · Tanmay Inamdar
Quoted 15 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_XGENE
drivers/pci/host/Kconfig: bool "X-Gene PCIe controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit.

Quoted 7 lines
Quoted 7 lines

We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.

Thanks for taking care of this, Paul.

I tested your patch and it worked fine on my X-Gene Mustang board.

One minor comment below.

Quoted 4 lines
Quoted 4 lines
---
 drivers/pci/host/pci-xgene.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
Quoted 10 lines

drivers/pci/host/pci-xgene.c line 24

Quoted 10 lines
drivers/pci/host/pci-xgene.c +1 -1
index 7eb20cc76dd3..a81273c23341 100644
@@ -21,7 +21,7 @@
 #include <linux/io.h>
 #include <linux/jiffies.h>
 #include <linux/memblock.h>
-#include <linux/module.h>
+#include <linux/init.h>

The platform_device.h already has builtin_platform_driver macro defined. So this init.h is not need?

Quoted 8 lines
Quoted 8 lines
drivers/pci/host/pci-xgene.c +0 -1
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
@@ -579,8 +579,4 @@ static struct platform_driver xgene_pcie_driver = {
        },
        .probe = xgene_pcie_probe_bridge,
 };
-module_platform_driver(xgene_pcie_driver);
Quoted 13 lines

drivers/pci/host/pci-xgene.c static struct platform_driver xgene_pcie_driver = { · line 582

Quoted 5 lines
drivers/pci/host/pci-xgene.c +1 -4
-
-MODULE_AUTHOR("Tanmay Inamdar <[email protected]>");
-MODULE_DESCRIPTION("APM X-Gene PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(xgene_pcie_driver);

Copying Duc.

Quoted 4 lines

--
2.8.4

Regards,
Duc Dang.

#24 lore raw

Re: [PATCH 14/14] PCI: xgene: make it explicitly non-modular

Quoted 38 lines · [Re: [PATCH 14/14] PCI: xgene: make it explicitly non-modular] On 07/07/2016…
Quoted 19 lines · Tanmay Inamdar
Quoted 15 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_XGENE
drivers/pci/host/Kconfig: bool "X-Gene PCIe controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit.

Quoted 7 lines
Quoted 7 lines

We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.

Thanks for taking care of this, Paul.

I tested your patch and it worked fine on my X-Gene Mustang board.

One minor comment below.

Quoted 4 lines
Quoted 4 lines
---
 drivers/pci/host/pci-xgene.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
Quoted 13 lines
Quoted 10 lines

drivers/pci/host/pci-xgene.c line 24

Quoted 10 lines
drivers/pci/host/pci-xgene.c +1 -1
index 7eb20cc76dd3..a81273c23341 100644
@@ -21,7 +21,7 @@
 #include <linux/io.h>
 #include <linux/jiffies.h>
 #include <linux/memblock.h>
-#include <linux/module.h>
+#include <linux/init.h>

The platform_device.h already has builtin_platform_driver macro defined. So this init.h is not need?

If you look, you will find that platform_device.h does not include the init.h even though it references __init; it can do this w/o error since all the references themselves are in a macro. However once code wants to be a consumer of those macros, they will need init.h present. Often you can overlook directly calling it out for inclusion since it gets sourced by another header, but it is best policy to list what gets used.

Thanks for testing!

Paul.
--

Quoted 24 lines
Quoted 22 lines
Quoted 5 lines
drivers/pci/host/pci-xgene.c +0 -0
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>

drivers/pci/host/pci-xgene.c static struct platform_driver xgene_pcie_driver = { · line 582

Quoted 9 lines
drivers/pci/host/pci-xgene.c +1 -5
@@ -579,8 +579,4 @@ static struct platform_driver xgene_pcie_driver = {
        },
        .probe = xgene_pcie_probe_bridge,
 };
-module_platform_driver(xgene_pcie_driver);
-
-MODULE_AUTHOR("Tanmay Inamdar <[email protected]>");
-MODULE_DESCRIPTION("APM X-Gene PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(xgene_pcie_driver);

Copying Duc.

Quoted 4 lines

--
2.8.4

Regards,
Duc Dang.

#25 lore raw

Re: [PATCH 14/14] PCI: xgene: make it explicitly non-modular

Quoted 55 lines · On Sat, Jul 9, 2016 at 16:15 Paul Gortmaker <[email protected]>…
Quoted 38 lines · [Re: [PATCH 14/14] PCI: xgene: make it explicitly non-modular] On 07/07/2016…
Quoted 19 lines · Tanmay Inamdar
Quoted 15 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_XGENE
drivers/pci/host/Kconfig: bool "X-Gene PCIe controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the few trace uses of modular code and macros, so that when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit.

Quoted 7 lines
Quoted 7 lines

We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.

Thanks for taking care of this, Paul.

I tested your patch and it worked fine on my X-Gene Mustang board.

One minor comment below.

Quoted 4 lines
Quoted 4 lines
---
 drivers/pci/host/pci-xgene.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
Quoted 13 lines
Quoted 10 lines

drivers/pci/host/pci-xgene.c line 24

Quoted 10 lines
drivers/pci/host/pci-xgene.c +1 -1
index 7eb20cc76dd3..a81273c23341 100644
@@ -21,7 +21,7 @@
 #include <linux/io.h>
 #include <linux/jiffies.h>
 #include <linux/memblock.h>
-#include <linux/module.h>
+#include <linux/init.h>

The platform_device.h already has builtin_platform_driver macro defined. So this init.h is not need?

Quoted 6 lines

If you look, you will find that platform_device.h does not include the init.h even though it references __init; it can do this w/o error since all the references themselves are in a macro. However once code wants to be a consumer of those macros, they will need init.h present. Often you can overlook directly calling it out for inclusion since it gets sourced by another header, but it is best policy to list what gets used.

Ah, got it.

Thanks, Paul!

Quoted 30 lines

Thanks for testing!

Paul.
--

Quoted 24 lines
Quoted 22 lines
Quoted 5 lines
drivers/pci/host/pci-xgene.c +0 -0
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>

drivers/pci/host/pci-xgene.c static struct platform_driver xgene_pcie_driver = { · line 582

Quoted 9 lines
drivers/pci/host/pci-xgene.c +1 -5
@@ -579,8 +579,4 @@ static struct platform_driver xgene_pcie_driver = {
        },
        .probe = xgene_pcie_probe_bridge,
 };
-module_platform_driver(xgene_pcie_driver);
-
-MODULE_AUTHOR("Tanmay Inamdar <[email protected]>");
-MODULE_DESCRIPTION("APM X-Gene PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(xgene_pcie_driver);

Copying Duc.

Quoted 4 lines

--
2.8.4

Regards,
Duc Dang.

#26 lore raw
In reply to Paul Gortmaker
Quoted 98 lines · Paul Gortmaker

Firstly, this group of commits was chosen for the fact that they don't change anything even at a binary object file level ; they just replace module_platform_driver with builtin_platform_driver, and remove some MODULE_<blah> tags that are no-ops in code. So the regression risk is zero here.

More specifically, we are doing the following to pci/host files that currently can only be built-in:

-- remove the include of module.h ; replace it with init.h as req'd

-- drop instances of MODULE_DEVICE_TABLE which is a no-op built-in.

-- replace module_platform_driver with builtin_platform_driver, which
is functionally identical once CPP has processed the source.

-- drop instances of MODULE_LICENSE, MODULE_AUTHOR, MODULE_DESCRIPTION
while ensuring the contained info is present in the file comments.

After considering the inital version of demodularization PCI host commits[1], we did consider striving for tristate[2] on another subset of PCI host files in order to keep bzImage sizes lower on multi-platform builds, but that proved to have technical challenges well outside the scope of what we are trying to achieve here, given PCI is infrastructure code and not a case of simple endpoint drivers.

In the meantime more new code copies the existing examples of bool Kconfig using modular references; further expanding the problem space. So we are just going to proceed with the demodularization as originally planned. Nothing removed here is rocket science, and can easily be restored if someone has the hardware to test on and the desire to expand functionality into the tristate realm.

A more complete description of why we are doing this can be found in the original posting[1] for those that haven't seen it yet.

This represents just over 1/2 the PCI drivers that have their Kconfig as bool but needlessly use modular references. The remainder do not deliver exact binary equivalence, since they delete unused __exit functions and/or unused ".remove" functions. So they are more appropriate for submission earlier in the next development window.

Build tested for allmodconfig on several arch, including ARM and ARM-64 on the most recent linux-next baseline.

Paul.

[1] https://lkml.kernel.org/r/[email protected]
[2] https://lkml.kernel.org/r/[email protected]

---

[vs v1 in [1] above, I tweaked the subjects slightly to match the
format used by most PCI commits, i.e drop the "driver/" prefix. ]

Cc Alexandre Courbot <[email protected]>
Cc Bjorn Helgaas <[email protected]>
Cc David Daney <[email protected]>
Cc Gabriele Paoloni <[email protected]>
Cc Jason Cooper <[email protected]>
Cc Jesper Nilsson <[email protected]>
Cc Jingoo Han <[email protected]>
Cc Joao Pinto <[email protected]>
Cc Minghuan Lian <[email protected]>
Cc Mingkai Hu <[email protected]>
Cc Murali Karicheri <[email protected]>
Cc Niklas Cassel <[email protected]>
Cc Phil Edworthy <[email protected]>
Cc Pratyush Anand <[email protected]>
Cc Roy Zang <[email protected]>
Cc Simon Horman <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Tanmay Inamdar <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Valentine Barshak <[email protected]>
Cc Will Deacon <[email protected]>
Cc Zhou Wang <[email protected]>

Paul Gortmaker (14):
PCI: armada8k: make it explicitly non-modular
PCI: artpec6: make it explicitly non-modular
PCI: designware-plat: make it explicitly non-modular
PCI: generic: make it explicitly non-modular
PCI: hisi: make it explicitly non-modular
PCI: keystone: make it explicitly non-modular
PCI: layerscape: make it explicitly non-modular
PCI: mvebu: make it explicitly non-modular
PCI: rcar: make it explicitly non-modular
PCI: rcar-gen2: make it explicitly non-modular
PCI: tegra: make it explicitly non-modular
PCI: thunder-ecam: make it explicitly non-modular
PCI: thunder-pem: make it explicitly non-modular
PCI: xgene: make it explicitly non-modular

Quoted 15 lines
 drivers/pci/host/pci-host-generic.c     | 10 ++--------
 drivers/pci/host/pci-keystone.c         | 10 ++--------
 drivers/pci/host/pci-layerscape.c       | 10 ++--------
 drivers/pci/host/pci-mvebu.c            | 11 ++++-------
 drivers/pci/host/pci-rcar-gen2.c        | 12 +++---------
 drivers/pci/host/pci-tegra.c            | 11 ++++-------
 drivers/pci/host/pci-thunder-ecam.c     |  8 ++------
 drivers/pci/host/pci-thunder-pem.c      |  8 ++------
 drivers/pci/host/pci-xgene.c            |  8 ++------
 drivers/pci/host/pcie-armada8k.c        | 14 +++++---------
 drivers/pci/host/pcie-artpec6.c         | 10 ++--------
 drivers/pci/host/pcie-designware-plat.c | 10 ++--------
 drivers/pci/host/pcie-hisi.c            | 13 ++-----------
 drivers/pci/host/pcie-rcar.c            | 11 ++++-------
 14 files changed, 38 insertions(+), 108 deletions(-)

Applied to pci/demodularize-hosts for v4.8, thanks, Paul!