linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/14] PCI: trivial demodularization of builtin code
@ 2016-07-02 23:13 Paul Gortmaker
  2016-07-02 23:13 ` [PATCH 01/14] PCI: armada8k: make it explicitly non-modular Paul Gortmaker
                   ` (14 more replies)
  0 siblings, 15 replies; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Alexandre Courbot, Bjorn Helgaas, David Daney,
	Gabriele Paoloni, Jason Cooper, Jesper Nilsson, Jingoo Han,
	Joao Pinto, Minghuan Lian, Mingkai Hu, Murali Karicheri,
	Niklas Cassel, Phil Edworthy, Pratyush Anand, Roy Zang,
	Simon Horman, Stephen Warren, Tanmay Inamdar, Thierry Reding,
	Thomas Petazzoni, Valentine Barshak, Will Deacon, Zhou Wang,
	linux-pci, linux-tegra

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/1449970917-12633-1-git-send-email-paul.gortmaker@windriver.com
[2] https://lkml.kernel.org/r/1454889644-27830-1-git-send-email-paul.gortmaker@windriver.com

---

[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 <gnurou@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: David Daney <david.daney@cavium.com>
Cc: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: Minghuan Lian <minghuan.Lian@freescale.com>
Cc: Mingkai Hu <mingkai.hu@freescale.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Niklas Cassel <niklas.cassel@axis.com>
Cc: Phil Edworthy <phil.edworthy@renesas.com>
Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Roy Zang <tie-fei.zang@freescale.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Tanmay Inamdar <tinamdar@apm.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Valentine Barshak <valentine.barshak@cogentembedded.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Zhou Wang <wangzhou1@hisilicon.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-tegra@vger.kernel.org

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(-)

-- 
2.8.4

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 01/14] PCI: armada8k: make it explicitly non-modular
  2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
@ 2016-07-02 23:13 ` Paul Gortmaker
  2016-07-02 23:13 ` [PATCH 02/14] PCI: artpec6: " Paul Gortmaker
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Bjorn Helgaas, Thomas Petazzoni, linux-pci

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.

Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pcie-armada8k.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/host/pcie-armada8k.c b/drivers/pci/host/pcie-armada8k.c
index 55723567b5d4..0f4f570068e3 100644
--- a/drivers/pci/host/pcie-armada8k.c
+++ b/drivers/pci/host/pcie-armada8k.c
@@ -5,6 +5,9 @@
  *
  * Copyright (C) 2016 Marvell Technology Group Ltd.
  *
+ * Author: Yehuda Yitshak <yehuday@marvell.com>
+ * Author: Shadi Ammouri <shadi@marvell.com>
+ *
  * 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 <yehuday@marvell.com>");
-MODULE_AUTHOR("Shadi Ammouri <shadi@marvell.com>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada8k_pcie_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 02/14] PCI: artpec6: make it explicitly non-modular
  2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
  2016-07-02 23:13 ` [PATCH 01/14] PCI: armada8k: make it explicitly non-modular Paul Gortmaker
@ 2016-07-02 23:13 ` Paul Gortmaker
  2016-07-02 23:13 ` [PATCH 03/14] PCI: designware-plat: " Paul Gortmaker
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Niklas Cassel, Jesper Nilsson, Bjorn Helgaas, linux-pci

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 <niklas.cassel@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.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-artpec6.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/pci/host/pcie-artpec6.c b/drivers/pci/host/pcie-artpec6.c
index be54fad4698b..73d4e8cb020b 100644
--- a/drivers/pci/host/pcie-artpec6.c
+++ b/drivers/pci/host/pcie-artpec6.c
@@ -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 <niklas.cassel@axis.com>");
-MODULE_DESCRIPTION("Axis ARTPEC-6 PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(artpec6_pcie_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 03/14] PCI: designware-plat: make it explicitly non-modular
  2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
  2016-07-02 23:13 ` [PATCH 01/14] PCI: armada8k: make it explicitly non-modular Paul Gortmaker
  2016-07-02 23:13 ` [PATCH 02/14] PCI: artpec6: " Paul Gortmaker
@ 2016-07-02 23:13 ` Paul Gortmaker
  2016-07-04  9:09   ` Joao Pinto
  2016-07-02 23:13 ` [PATCH 04/14] PCI: generic: " Paul Gortmaker
                   ` (11 subsequent siblings)
  14 siblings, 1 reply; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Jingoo Han, Pratyush Anand, Joao Pinto,
	Bjorn Helgaas, linux-pci

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 <jingoohan1@gmail.com>
Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Joao Pinto <jpinto@synopsys.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-designware-plat.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/pci/host/pcie-designware-plat.c b/drivers/pci/host/pcie-designware-plat.c
index b3500994d08a..c8079dc81c10 100644
--- a/drivers/pci/host/pcie-designware-plat.c
+++ b/drivers/pci/host/pcie-designware-plat.c
@@ -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 <Joao.Pinto@synopsys.com>");
-MODULE_DESCRIPTION("Synopsys PCIe host controller glue platform driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(dw_plat_pcie_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 04/14] PCI: generic: make it explicitly non-modular
  2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
                   ` (2 preceding siblings ...)
  2016-07-02 23:13 ` [PATCH 03/14] PCI: designware-plat: " Paul Gortmaker
@ 2016-07-02 23:13 ` Paul Gortmaker
  2016-07-04 17:37   ` Will Deacon
  2016-07-06 17:02   ` Will Deacon
  2016-07-02 23:13 ` [PATCH 05/14] PCI: hisi: " Paul Gortmaker
                   ` (10 subsequent siblings)
  14 siblings, 2 replies; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Will Deacon, Bjorn Helgaas, linux-pci

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.

Cc: Will Deacon <will.deacon@arm.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/pci-host-generic.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/pci/host/pci-host-generic.c b/drivers/pci/host/pci-host-generic.c
index f0ca6de0d87e..c05ea9d72f69 100644
--- a/drivers/pci/host/pci-host-generic.c
+++ b/drivers/pci/host/pci-host-generic.c
@@ -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 <will.deacon@arm.com>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(gen_pci_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 05/14] PCI: hisi: make it explicitly non-modular
  2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
                   ` (3 preceding siblings ...)
  2016-07-02 23:13 ` [PATCH 04/14] PCI: generic: " Paul Gortmaker
@ 2016-07-02 23:13 ` Paul Gortmaker
  2016-07-02 23:13 ` [PATCH 06/14] PCI: keystone: " Paul Gortmaker
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Zhou Wang, Dacai Zhu, Gabriele Paoloni,
	Bjorn Helgaas, linux-pci

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 <wangzhou1@hisilicon.com>
Cc: Dacai Zhu <zhudacai@hisilicon.com>
Cc: Gabriele Paoloni <gabriele.paoloni@huawei.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-hisi.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/pci/host/pcie-hisi.c b/drivers/pci/host/pcie-hisi.c
index 3e98d4edae2d..7ee9dfcc45fb 100644
--- a/drivers/pci/host/pcie-hisi.c
+++ b/drivers/pci/host/pcie-hisi.c
@@ -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 <wangzhou1@hisilicon.com>");
-MODULE_AUTHOR("Dacai Zhu <zhudacai@hisilicon.com>");
-MODULE_AUTHOR("Gabriele Paoloni <gabriele.paoloni@huawei.com>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(hisi_pcie_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 06/14] PCI: keystone: make it explicitly non-modular
  2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
                   ` (4 preceding siblings ...)
  2016-07-02 23:13 ` [PATCH 05/14] PCI: hisi: " Paul Gortmaker
@ 2016-07-02 23:13 ` Paul Gortmaker
  2016-07-06 19:28   ` Murali Karicheri
  2016-07-02 23:13 ` [PATCH 07/14] PCI: layerscape: " Paul Gortmaker
                   ` (8 subsequent siblings)
  14 siblings, 1 reply; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Murali Karicheri, Bjorn Helgaas, linux-pci

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.

Cc: Murali Karicheri <m-karicheri2@ti.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/pci-keystone.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/pci/host/pci-keystone.c b/drivers/pci/host/pci-keystone.c
index 6b8301ef21ca..8ba28834d470 100644
--- a/drivers/pci/host/pci-keystone.c
+++ b/drivers/pci/host/pci-keystone.c
@@ -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 <m-karicheri2@ti.com>");
-MODULE_DESCRIPTION("Keystone PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(ks_pcie_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 07/14] PCI: layerscape: make it explicitly non-modular
  2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
                   ` (5 preceding siblings ...)
  2016-07-02 23:13 ` [PATCH 06/14] PCI: keystone: " Paul Gortmaker
@ 2016-07-02 23:13 ` Paul Gortmaker
  2016-07-02 23:13 ` [PATCH 08/14] PCI: mvebu: " Paul Gortmaker
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Minghuan Lian, Mingkai Hu, Roy Zang,
	Bjorn Helgaas, linux-pci

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 <minghuan.Lian@freescale.com>
Cc: Mingkai Hu <mingkai.hu@freescale.com>
Cc: Roy Zang <tie-fei.zang@freescale.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/pci-layerscape.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/pci/host/pci-layerscape.c b/drivers/pci/host/pci-layerscape.c
index a21e229d95e0..114ba819277a 100644
--- a/drivers/pci/host/pci-layerscape.c
+++ b/drivers/pci/host/pci-layerscape.c
@@ -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 <Minghuan.Lian@freescale.com>");
-MODULE_DESCRIPTION("Freescale Layerscape PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver_probe(ls_pcie_driver, ls_pcie_probe);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 08/14] PCI: mvebu: make it explicitly non-modular
  2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
                   ` (6 preceding siblings ...)
  2016-07-02 23:13 ` [PATCH 07/14] PCI: layerscape: " Paul Gortmaker
@ 2016-07-02 23:13 ` Paul Gortmaker
  2016-07-02 23:13 ` [PATCH 09/14] PCI: rcar: " Paul Gortmaker
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Thomas Petazzoni, Jason Cooper, Bjorn Helgaas, linux-pci

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.

Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-mvebu.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index 2287a4e18add..4545d204f864 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -1,6 +1,8 @@
 /*
  * PCIe driver for Marvell Armada 370 and Armada XP SoCs
  *
+ * Module Author: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ *
  * 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 <thomas.petazzoni@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell EBU PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(mvebu_pcie_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 09/14] PCI: rcar: make it explicitly non-modular
  2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
                   ` (7 preceding siblings ...)
  2016-07-02 23:13 ` [PATCH 08/14] PCI: mvebu: " Paul Gortmaker
@ 2016-07-02 23:13 ` Paul Gortmaker
  2016-07-02 23:13 ` [PATCH 10/14] PCI: rcar-gen2: " Paul Gortmaker
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Simon Horman, Bjorn Helgaas, linux-pci, Phil Edworthy

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.

Cc: Simon Horman <horms@verge.net.au>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Cc: Phil Edworthy <phil.edworthy@renesas.com>
Acked-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pcie-rcar.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index 6546ca79f188..7e61ae41910e 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -7,6 +7,8 @@
  *  arch/sh/drivers/pci/ops-sh7786.c
  *  Copyright (C) 2009 - 2011  Paul Mundt
  *
+ * Module Author: Phil Edworthy <phil.edworthy@renesas.com>
+ *
  * 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 <phil.edworthy@renesas.com>");
-MODULE_DESCRIPTION("Renesas R-Car PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(rcar_pcie_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 10/14] PCI: rcar-gen2: make it explicitly non-modular
  2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
                   ` (8 preceding siblings ...)
  2016-07-02 23:13 ` [PATCH 09/14] PCI: rcar: " Paul Gortmaker
@ 2016-07-02 23:13 ` Paul Gortmaker
  2016-07-02 23:13 ` [PATCH 11/14] PCI: tegra: " Paul Gortmaker
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Simon Horman, Bjorn Helgaas, Phil Edworthy,
	Valentine Barshak, linux-pci

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.

Cc: Simon Horman <horms@verge.net.au>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Phil Edworthy <phil.edworthy@renesas.com>
Cc: Valentine Barshak <valentine.barshak@cogentembedded.com>
Acked-by: Phil Edworthy <phil.edworthy@renesas.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-rcar-gen2.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c
index e8f5ac84b2c6..77a451cd3e32 100644
--- a/drivers/pci/host/pci-rcar-gen2.c
+++ b/drivers/pci/host/pci-rcar-gen2.c
@@ -4,6 +4,8 @@
  * Copyright (C) 2013 Renesas Solutions Corp.
  * Copyright (C) 2013 Cogent Embedded, Inc.
  *
+ * Module Author: Valentine Barshak <valentine.barshak@cogentembedded.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 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 <valentine.barshak@cogentembedded.com>");
+builtin_platform_driver(rcar_pci_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 11/14] PCI: tegra: make it explicitly non-modular
  2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
                   ` (9 preceding siblings ...)
  2016-07-02 23:13 ` [PATCH 10/14] PCI: rcar-gen2: " Paul Gortmaker
@ 2016-07-02 23:13 ` Paul Gortmaker
  2016-07-02 23:13 ` [PATCH 12/14] PCI: thunder-ecam: " Paul Gortmaker
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Thierry Reding, Bjorn Helgaas, Stephen Warren,
	Alexandre Courbot, linux-tegra, linux-pci

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 <thierry.reding@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: linux-tegra@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-tegra.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 013d5488f9f8..c9a8eb252f50 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -9,6 +9,8 @@
  *
  * Bits taken from arch/arm/mach-dove/pcie.c
  *
+ * Author: Thierry Reding <treding@nvidia.com>
+ *
  * 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 <treding@nvidia.com>");
-MODULE_DESCRIPTION("NVIDIA Tegra PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(tegra_pcie_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 12/14] PCI: thunder-ecam: make it explicitly non-modular
  2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
                   ` (10 preceding siblings ...)
  2016-07-02 23:13 ` [PATCH 11/14] PCI: tegra: " Paul Gortmaker
@ 2016-07-02 23:13 ` Paul Gortmaker
  2016-07-02 23:13 ` [PATCH 13/14] PCI: thunder-pem: " Paul Gortmaker
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, David Daney, Bjorn Helgaas, linux-pci

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.

Cc: David Daney <david.daney@cavium.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/pci-thunder-ecam.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/host/pci-thunder-ecam.c b/drivers/pci/host/pci-thunder-ecam.c
index a9fc1c9105fd..d50a3dc2d8db 100644
--- a/drivers/pci/host/pci-thunder-ecam.c
+++ b/drivers/pci/host/pci-thunder-ecam.c
@@ -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);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 13/14] PCI: thunder-pem: make it explicitly non-modular
  2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
                   ` (11 preceding siblings ...)
  2016-07-02 23:13 ` [PATCH 12/14] PCI: thunder-ecam: " Paul Gortmaker
@ 2016-07-02 23:13 ` Paul Gortmaker
  2016-07-02 23:13 ` [PATCH 14/14] PCI: xgene: " Paul Gortmaker
  2016-07-22 21:52 ` [PATCH 00/14] PCI: trivial demodularization of builtin code Bjorn Helgaas
  14 siblings, 0 replies; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, David Daney, Bjorn Helgaas, linux-pci

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.

Cc: David Daney <david.daney@cavium.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/pci-thunder-pem.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/host/pci-thunder-pem.c b/drivers/pci/host/pci-thunder-pem.c
index 91f6fc68d374..6abaf80ffb39 100644
--- a/drivers/pci/host/pci-thunder-pem.c
+++ b/drivers/pci/host/pci-thunder-pem.c
@@ -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);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 14/14] PCI: xgene: make it explicitly non-modular
  2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
                   ` (12 preceding siblings ...)
  2016-07-02 23:13 ` [PATCH 13/14] PCI: thunder-pem: " Paul Gortmaker
@ 2016-07-02 23:13 ` Paul Gortmaker
       [not found]   ` <CACoXjc=Tw2a_oCvxTmZY+7jeyyb9XvLF1yWx9FEPWekPBaAw1g@mail.gmail.com>
  2016-07-22 21:52 ` [PATCH 00/14] PCI: trivial demodularization of builtin code Bjorn Helgaas
  14 siblings, 1 reply; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Tanmay Inamdar, Bjorn Helgaas, linux-pci

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.

Cc: Tanmay Inamdar <tinamdar@apm.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/pci-xgene.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c
index 7eb20cc76dd3..a81273c23341 100644
--- a/drivers/pci/host/pci-xgene.c
+++ b/drivers/pci/host/pci-xgene.c
@@ -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 <tinamdar@apm.com>");
-MODULE_DESCRIPTION("APM X-Gene PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(xgene_pcie_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH 03/14] PCI: designware-plat: make it explicitly non-modular
  2016-07-02 23:13 ` [PATCH 03/14] PCI: designware-plat: " Paul Gortmaker
@ 2016-07-04  9:09   ` Joao Pinto
  0 siblings, 0 replies; 26+ messages in thread
From: Joao Pinto @ 2016-07-04  9:09 UTC (permalink / raw)
  To: Paul Gortmaker, linux-kernel
  Cc: Jingoo Han, Pratyush Anand, Joao Pinto, Bjorn Helgaas, linux-pci

Hi Paul,

On 7/3/2016 12:13 AM, Paul Gortmaker wrote:
> 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...)

> Cc: Jingoo Han <jingoohan1@gmail.com>
> Cc: Pratyush Anand <pratyush.anand@gmail.com>
> Cc: Joao Pinto <jpinto@synopsys.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-designware-plat.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/pci/host/pcie-designware-plat.c b/drivers/pci/host/pcie-designware-plat.c
> index b3500994d08a..c8079dc81c10 100644
> --- a/drivers/pci/host/pcie-designware-plat.c
> +++ b/drivers/pci/host/pcie-designware-plat.c
> @@ -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 <Joao.Pinto@synopsys.com>");
> -MODULE_DESCRIPTION("Synopsys PCIe host controller glue platform driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(dw_plat_pcie_driver);
> 

Makes totally sense! Thanks!

Acked-by: Joao Pinto <jpinto@synopsys.com>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular
  2016-07-02 23:13 ` [PATCH 04/14] PCI: generic: " Paul Gortmaker
@ 2016-07-04 17:37   ` Will Deacon
  2016-07-05 20:19     ` David Daney
  2016-07-06 17:02   ` Will Deacon
  1 sibling, 1 reply; 26+ messages in thread
From: Will Deacon @ 2016-07-04 17:37 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Bjorn Helgaas, linux-pci, arnd, david.daney, jchandra

On Sat, Jul 02, 2016 at 07:13:24PM -0400, Paul Gortmaker wrote:
> 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.

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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular
  2016-07-04 17:37   ` Will Deacon
@ 2016-07-05 20:19     ` David Daney
  2016-07-06  4:25       ` Jayachandran C
  0 siblings, 1 reply; 26+ messages in thread
From: David Daney @ 2016-07-05 20:19 UTC (permalink / raw)
  To: Will Deacon
  Cc: Paul Gortmaker, linux-kernel, Bjorn Helgaas, linux-pci, arnd,
	david.daney, jchandra

On 07/04/2016 10:37 AM, Will Deacon wrote:
> On Sat, Jul 02, 2016 at 07:13:24PM -0400, Paul Gortmaker wrote:
>> 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.
>
> 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.


>
> Will
>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular
  2016-07-05 20:19     ` David Daney
@ 2016-07-06  4:25       ` Jayachandran C
  0 siblings, 0 replies; 26+ messages in thread
From: Jayachandran C @ 2016-07-06  4:25 UTC (permalink / raw)
  To: David Daney
  Cc: Will Deacon, Paul Gortmaker, Linux Kernel Mailing List,
	Bjorn Helgaas, Linux PCI, Arnd Bergmann, david.daney

On Wed, Jul 6, 2016 at 1:49 AM, David Daney <ddaney@caviumnetworks.com> wrote:
>
> On 07/04/2016 10:37 AM, Will Deacon wrote:
>>
>> On Sat, Jul 02, 2016 at 07:13:24PM -0400, Paul Gortmaker wrote:
>>>
>>> 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.
>>
>>
>> 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.
>

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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular
  2016-07-02 23:13 ` [PATCH 04/14] PCI: generic: " Paul Gortmaker
  2016-07-04 17:37   ` Will Deacon
@ 2016-07-06 17:02   ` Will Deacon
  2016-07-06 17:39     ` Paul Gortmaker
  1 sibling, 1 reply; 26+ messages in thread
From: Will Deacon @ 2016-07-06 17:02 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Bjorn Helgaas, linux-pci

On Sat, Jul 02, 2016 at 07:13:24PM -0400, Paul Gortmaker wrote:
> 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.
> 
> Cc: Will Deacon <will.deacon@arm.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/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:

Acked-by: Will Deacon <will.deacon@arm.com>

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

Will

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular
  2016-07-06 17:02   ` Will Deacon
@ 2016-07-06 17:39     ` Paul Gortmaker
  0 siblings, 0 replies; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-06 17:39 UTC (permalink / raw)
  To: Will Deacon; +Cc: linux-kernel, Bjorn Helgaas, linux-pci

[Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular] On 06/07/2016 (Wed 18:02) Will Deacon wrote:

> On Sat, Jul 02, 2016 at 07:13:24PM -0400, Paul Gortmaker wrote:
> > 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.
> > 
> > Cc: Will Deacon <will.deacon@arm.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/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:
> 
> Acked-by: Will Deacon <will.deacon@arm.com>
> 
> 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.
--

> 
> Will

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 06/14] PCI: keystone: make it explicitly non-modular
  2016-07-02 23:13 ` [PATCH 06/14] PCI: keystone: " Paul Gortmaker
@ 2016-07-06 19:28   ` Murali Karicheri
  0 siblings, 0 replies; 26+ messages in thread
From: Murali Karicheri @ 2016-07-06 19:28 UTC (permalink / raw)
  To: Paul Gortmaker, linux-kernel; +Cc: Bjorn Helgaas, linux-pci

On 07/02/2016 07:13 PM, Paul Gortmaker wrote:
> 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.
> 
> Cc: Murali Karicheri <m-karicheri2@ti.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/pci-keystone.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/pci/host/pci-keystone.c b/drivers/pci/host/pci-keystone.c
> index 6b8301ef21ca..8ba28834d470 100644
> --- a/drivers/pci/host/pci-keystone.c
> +++ b/drivers/pci/host/pci-keystone.c
> @@ -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 <m-karicheri2@ti.com>");
> -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. 

Tested-By: Murali Karicheri <m-karicheri2@ti.com>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 14/14] PCI: xgene: make it explicitly non-modular
       [not found]   ` <CACoXjc=Tw2a_oCvxTmZY+7jeyyb9XvLF1yWx9FEPWekPBaAw1g@mail.gmail.com>
@ 2016-07-07 22:42     ` Duc Dang
  2016-07-09 23:15       ` Paul Gortmaker
  0 siblings, 1 reply; 26+ messages in thread
From: Duc Dang @ 2016-07-07 22:42 UTC (permalink / raw)
  To: Tanmay Inamdar
  Cc: Paul Gortmaker, Linux Kernel Mailing List, Bjorn Helgaas, linux-pci

On Thu, Jul 7, 2016 at 3:35 PM, Tanmay Inamdar <tinamdar@apm.com> wrote:
>
>
> On Sat, Jul 2, 2016 at 4:13 PM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
>>
>> 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.
>>
>> Cc: Tanmay Inamdar <tinamdar@apm.com>
>> Cc: Bjorn Helgaas <bhelgaas@google.com>
>> Cc: linux-pci@vger.kernel.org
>> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

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.

>> ---
>>  drivers/pci/host/pci-xgene.c | 8 ++------
>>  1 file changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c
>> index 7eb20cc76dd3..a81273c23341 100644
>> --- a/drivers/pci/host/pci-xgene.c
>> +++ b/drivers/pci/host/pci-xgene.c
>> @@ -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?

>>  #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 <tinamdar@apm.com>");
>> -MODULE_DESCRIPTION("APM X-Gene PCIe driver");
>> -MODULE_LICENSE("GPL v2");
>> +builtin_platform_driver(xgene_pcie_driver);
>
>
> Copying Duc.
>>
>> --
>> 2.8.4
>>
>
Regards,
Duc Dang.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 14/14] PCI: xgene: make it explicitly non-modular
  2016-07-07 22:42     ` Duc Dang
@ 2016-07-09 23:15       ` Paul Gortmaker
  2016-07-11 17:12         ` Duc Dang
  0 siblings, 1 reply; 26+ messages in thread
From: Paul Gortmaker @ 2016-07-09 23:15 UTC (permalink / raw)
  To: Duc Dang
  Cc: Tanmay Inamdar, Linux Kernel Mailing List, Bjorn Helgaas, linux-pci

[Re: [PATCH 14/14] PCI: xgene: make it explicitly non-modular] On 07/07/2016 (Thu 15:42) Duc Dang wrote:

> On Thu, Jul 7, 2016 at 3:35 PM, Tanmay Inamdar <tinamdar@apm.com> wrote:
> >
> >
> > On Sat, Jul 2, 2016 at 4:13 PM, Paul Gortmaker
> > <paul.gortmaker@windriver.com> wrote:
> >>
> >> 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.
> >>
> >> Cc: Tanmay Inamdar <tinamdar@apm.com>
> >> Cc: Bjorn Helgaas <bhelgaas@google.com>
> >> Cc: linux-pci@vger.kernel.org
> >> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> 
> 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.
> 
> >> ---
> >>  drivers/pci/host/pci-xgene.c | 8 ++------
> >>  1 file changed, 2 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c
> >> index 7eb20cc76dd3..a81273c23341 100644
> >> --- a/drivers/pci/host/pci-xgene.c
> >> +++ b/drivers/pci/host/pci-xgene.c
> >> @@ -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.
--

> 
> >>  #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 <tinamdar@apm.com>");
> >> -MODULE_DESCRIPTION("APM X-Gene PCIe driver");
> >> -MODULE_LICENSE("GPL v2");
> >> +builtin_platform_driver(xgene_pcie_driver);
> >
> >
> > Copying Duc.
> >>
> >> --
> >> 2.8.4
> >>
> >
> Regards,
> Duc Dang.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 14/14] PCI: xgene: make it explicitly non-modular
  2016-07-09 23:15       ` Paul Gortmaker
@ 2016-07-11 17:12         ` Duc Dang
  0 siblings, 0 replies; 26+ messages in thread
From: Duc Dang @ 2016-07-11 17:12 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: Tanmay Inamdar, Linux Kernel Mailing List, Bjorn Helgaas, linux-pci

On Sat, Jul 9, 2016 at 16:15 Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
>
> [Re: [PATCH 14/14] PCI: xgene: make it explicitly non-modular] On 07/07/2016 (Thu 15:42) Duc Dang wrote:
>
> > On Thu, Jul 7, 2016 at 3:35 PM, Tanmay Inamdar <tinamdar@apm.com> wrote:
> > >
> > >
> > > On Sat, Jul 2, 2016 at 4:13 PM, Paul Gortmaker
> > > <paul.gortmaker@windriver.com> wrote:
> > >>
> > >> 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.
> > >>
> > >> Cc: Tanmay Inamdar <tinamdar@apm.com>
> > >> Cc: Bjorn Helgaas <bhelgaas@google.com>
> > >> Cc: linux-pci@vger.kernel.org
> > >> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> >
> > 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.
> >
> > >> ---
> > >>  drivers/pci/host/pci-xgene.c | 8 ++------
> > >>  1 file changed, 2 insertions(+), 6 deletions(-)
> > >>
> > >> diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c
> > >> index 7eb20cc76dd3..a81273c23341 100644
> > >> --- a/drivers/pci/host/pci-xgene.c
> > >> +++ b/drivers/pci/host/pci-xgene.c
> > >> @@ -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.

Ah, got it.

Thanks, Paul!
>
> Thanks for testing!
>
> Paul.
> --
>
> >
> > >>  #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 <tinamdar@apm.com>");
> > >> -MODULE_DESCRIPTION("APM X-Gene PCIe driver");
> > >> -MODULE_LICENSE("GPL v2");
> > >> +builtin_platform_driver(xgene_pcie_driver);
> > >
> > >
> > > Copying Duc.
> > >>
> > >> --
> > >> 2.8.4
> > >>
> > >
> > Regards,
> > Duc Dang.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 00/14] PCI: trivial demodularization of builtin code
  2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
                   ` (13 preceding siblings ...)
  2016-07-02 23:13 ` [PATCH 14/14] PCI: xgene: " Paul Gortmaker
@ 2016-07-22 21:52 ` Bjorn Helgaas
  14 siblings, 0 replies; 26+ messages in thread
From: Bjorn Helgaas @ 2016-07-22 21:52 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Alexandre Courbot, Bjorn Helgaas, David Daney,
	Gabriele Paoloni, Jason Cooper, Jesper Nilsson, Jingoo Han,
	Joao Pinto, Minghuan Lian, Mingkai Hu, Murali Karicheri,
	Niklas Cassel, Phil Edworthy, Pratyush Anand, Roy Zang,
	Simon Horman, Stephen Warren, Tanmay Inamdar, Thierry Reding,
	Thomas Petazzoni, Valentine Barshak, Will Deacon, Zhou Wang,
	linux-pci, linux-tegra

On Sat, Jul 02, 2016 at 07:13:20PM -0400, Paul Gortmaker wrote:
> 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/1449970917-12633-1-git-send-email-paul.gortmaker@windriver.com
> [2] https://lkml.kernel.org/r/1454889644-27830-1-git-send-email-paul.gortmaker@windriver.com
> 
> ---
> 
> [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 <gnurou@gmail.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: David Daney <david.daney@cavium.com>
> Cc: Gabriele Paoloni <gabriele.paoloni@huawei.com>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Jesper Nilsson <jesper.nilsson@axis.com>
> Cc: Jingoo Han <jingoohan1@gmail.com>
> Cc: Joao Pinto <jpinto@synopsys.com>
> Cc: Minghuan Lian <minghuan.Lian@freescale.com>
> Cc: Mingkai Hu <mingkai.hu@freescale.com>
> Cc: Murali Karicheri <m-karicheri2@ti.com>
> Cc: Niklas Cassel <niklas.cassel@axis.com>
> Cc: Phil Edworthy <phil.edworthy@renesas.com>
> Cc: Pratyush Anand <pratyush.anand@gmail.com>
> Cc: Roy Zang <tie-fei.zang@freescale.com>
> Cc: Simon Horman <horms@verge.net.au>
> Cc: Stephen Warren <swarren@wwwdotorg.org>
> Cc: Tanmay Inamdar <tinamdar@apm.com>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Valentine Barshak <valentine.barshak@cogentembedded.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Zhou Wang <wangzhou1@hisilicon.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-tegra@vger.kernel.org
> 
> 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(-)

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

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2016-07-22 21:52 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
2016-07-02 23:13 ` [PATCH 01/14] PCI: armada8k: make it explicitly non-modular Paul Gortmaker
2016-07-02 23:13 ` [PATCH 02/14] PCI: artpec6: " Paul Gortmaker
2016-07-02 23:13 ` [PATCH 03/14] PCI: designware-plat: " Paul Gortmaker
2016-07-04  9:09   ` Joao Pinto
2016-07-02 23:13 ` [PATCH 04/14] PCI: generic: " Paul Gortmaker
2016-07-04 17:37   ` Will Deacon
2016-07-05 20:19     ` David Daney
2016-07-06  4:25       ` Jayachandran C
2016-07-06 17:02   ` Will Deacon
2016-07-06 17:39     ` Paul Gortmaker
2016-07-02 23:13 ` [PATCH 05/14] PCI: hisi: " Paul Gortmaker
2016-07-02 23:13 ` [PATCH 06/14] PCI: keystone: " Paul Gortmaker
2016-07-06 19:28   ` Murali Karicheri
2016-07-02 23:13 ` [PATCH 07/14] PCI: layerscape: " Paul Gortmaker
2016-07-02 23:13 ` [PATCH 08/14] PCI: mvebu: " Paul Gortmaker
2016-07-02 23:13 ` [PATCH 09/14] PCI: rcar: " Paul Gortmaker
2016-07-02 23:13 ` [PATCH 10/14] PCI: rcar-gen2: " Paul Gortmaker
2016-07-02 23:13 ` [PATCH 11/14] PCI: tegra: " Paul Gortmaker
2016-07-02 23:13 ` [PATCH 12/14] PCI: thunder-ecam: " Paul Gortmaker
2016-07-02 23:13 ` [PATCH 13/14] PCI: thunder-pem: " Paul Gortmaker
2016-07-02 23:13 ` [PATCH 14/14] PCI: xgene: " Paul Gortmaker
     [not found]   ` <CACoXjc=Tw2a_oCvxTmZY+7jeyyb9XvLF1yWx9FEPWekPBaAw1g@mail.gmail.com>
2016-07-07 22:42     ` Duc Dang
2016-07-09 23:15       ` Paul Gortmaker
2016-07-11 17:12         ` Duc Dang
2016-07-22 21:52 ` [PATCH 00/14] PCI: trivial demodularization of builtin code Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).