linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] PCI: dwc: pci-dra7xx: miscellaneous improvements
@ 2021-05-17 15:41 Luca Ceresoli
  2021-05-17 15:41 ` [PATCH 1/5] PCI: dwc: export more symbols to allow modular drivers Luca Ceresoli
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Luca Ceresoli @ 2021-05-17 15:41 UTC (permalink / raw)
  To: linux-pci
  Cc: Luca Ceresoli, linux-omap, linux-arm-kernel, linux-kernel,
	Kishon Vijay Abraham I, Lorenzo Pieralisi, Rob Herring,
	Bjorn Helgaas, Jingoo Han, Gustavo Pimentel

This is an series of mixed improvements to the DRA7 PCI controller driver:
allow building as a loadabel module, allow to get and enable a clock and a
small cleanup.

Luca

Luca Ceresoli (5):
  PCI: dwc: export more symbols to allow modular drivers
  PCI: dwc: pci-dra7xx: make it a kernel module
  PCI: dwc: pci-dra7xx: allow to build as a loadable module
  PCI: dwc: pci-dra7xx: remove unused include
  PCI: dwc: pci-dra7xx: get an optional clock

 drivers/pci/controller/dwc/Kconfig            |  6 +++---
 drivers/pci/controller/dwc/pci-dra7xx.c       | 21 +++++++++++++++++--
 .../pci/controller/dwc/pcie-designware-ep.c   |  1 +
 drivers/pci/controller/dwc/pcie-designware.c  |  1 +
 4 files changed, 24 insertions(+), 5 deletions(-)

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/5] PCI: dwc: export more symbols to allow modular drivers
  2021-05-17 15:41 [PATCH 0/5] PCI: dwc: pci-dra7xx: miscellaneous improvements Luca Ceresoli
@ 2021-05-17 15:41 ` Luca Ceresoli
  2021-05-17 15:41 ` [PATCH 2/5] PCI: dwc: pci-dra7xx: make it a kernel module Luca Ceresoli
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Luca Ceresoli @ 2021-05-17 15:41 UTC (permalink / raw)
  To: linux-pci
  Cc: Luca Ceresoli, linux-omap, linux-arm-kernel, linux-kernel,
	Kishon Vijay Abraham I, Lorenzo Pieralisi, Rob Herring,
	Bjorn Helgaas, Jingoo Han, Gustavo Pimentel

These symbols are used by the pci-dra7xx driver. Export them to allow
building pci-dra7xx as a module.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 drivers/pci/controller/dwc/pcie-designware-ep.c | 1 +
 drivers/pci/controller/dwc/pcie-designware.c    | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
index 8d028a88b375..f2692a138216 100644
--- a/drivers/pci/controller/dwc/pcie-designware-ep.c
+++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
@@ -83,6 +83,7 @@ void dw_pcie_ep_reset_bar(struct dw_pcie *pci, enum pci_barno bar)
 	for (func_no = 0; func_no < funcs; func_no++)
 		__dw_pcie_ep_reset_bar(pci, func_no, bar, 0);
 }
+EXPORT_SYMBOL_GPL(dw_pcie_ep_reset_bar);
 
 static u8 __dw_pcie_ep_find_next_cap(struct dw_pcie_ep *ep, u8 func_no,
 		u8 cap_ptr, u8 cap)
diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
index a945f0c0e73d..850b4533f4ef 100644
--- a/drivers/pci/controller/dwc/pcie-designware.c
+++ b/drivers/pci/controller/dwc/pcie-designware.c
@@ -538,6 +538,7 @@ int dw_pcie_link_up(struct dw_pcie *pci)
 	return ((val & PCIE_PORT_DEBUG1_LINK_UP) &&
 		(!(val & PCIE_PORT_DEBUG1_LINK_IN_TRAINING)));
 }
+EXPORT_SYMBOL_GPL(dw_pcie_link_up);
 
 void dw_pcie_upconfig_setup(struct dw_pcie *pci)
 {
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/5] PCI: dwc: pci-dra7xx: make it a kernel module
  2021-05-17 15:41 [PATCH 0/5] PCI: dwc: pci-dra7xx: miscellaneous improvements Luca Ceresoli
  2021-05-17 15:41 ` [PATCH 1/5] PCI: dwc: export more symbols to allow modular drivers Luca Ceresoli
@ 2021-05-17 15:41 ` Luca Ceresoli
  2021-05-18 18:55   ` Rob Herring
  2021-05-17 15:41 ` [PATCH 3/5] PCI: dwc: pci-dra7xx: allow to build as a loadable module Luca Ceresoli
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Luca Ceresoli @ 2021-05-17 15:41 UTC (permalink / raw)
  To: linux-pci
  Cc: Luca Ceresoli, linux-omap, linux-arm-kernel, linux-kernel,
	Kishon Vijay Abraham I, Lorenzo Pieralisi, Rob Herring,
	Bjorn Helgaas, Jingoo Han, Gustavo Pimentel

This allows to build the driver as a loadable kernel module.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 drivers/pci/controller/dwc/pci-dra7xx.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c
index 6457695df00c..fe11b96fe9a5 100644
--- a/drivers/pci/controller/dwc/pci-dra7xx.c
+++ b/drivers/pci/controller/dwc/pci-dra7xx.c
@@ -15,6 +15,7 @@
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
 #include <linux/of_pci.h>
@@ -949,4 +950,8 @@ static struct platform_driver dra7xx_pcie_driver = {
 	},
 	.shutdown = dra7xx_pcie_shutdown,
 };
-builtin_platform_driver(dra7xx_pcie_driver);
+module_platform_driver(dra7xx_pcie_driver);
+
+MODULE_AUTHOR("Kishon Vijay Abraham I <kishon@ti.com>");
+MODULE_DESCRIPTION("PCIe controller driver for TI DRA7xx SoCs");
+MODULE_LICENSE("GPL v2");
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 3/5] PCI: dwc: pci-dra7xx: allow to build as a loadable module
  2021-05-17 15:41 [PATCH 0/5] PCI: dwc: pci-dra7xx: miscellaneous improvements Luca Ceresoli
  2021-05-17 15:41 ` [PATCH 1/5] PCI: dwc: export more symbols to allow modular drivers Luca Ceresoli
  2021-05-17 15:41 ` [PATCH 2/5] PCI: dwc: pci-dra7xx: make it a kernel module Luca Ceresoli
@ 2021-05-17 15:41 ` Luca Ceresoli
  2021-05-17 15:41 ` [PATCH 4/5] PCI: dwc: pci-dra7xx: remove unused include Luca Ceresoli
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Luca Ceresoli @ 2021-05-17 15:41 UTC (permalink / raw)
  To: linux-pci
  Cc: Luca Ceresoli, linux-omap, linux-arm-kernel, linux-kernel,
	Kishon Vijay Abraham I, Lorenzo Pieralisi, Rob Herring,
	Bjorn Helgaas, Jingoo Han, Gustavo Pimentel

Allow the pci-dra7xx PCIe controller to be build as a loadable module.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 drivers/pci/controller/dwc/Kconfig | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig
index 423d35872ce4..775ad590966e 100644
--- a/drivers/pci/controller/dwc/Kconfig
+++ b/drivers/pci/controller/dwc/Kconfig
@@ -17,10 +17,10 @@ config PCIE_DW_EP
 	select PCIE_DW
 
 config PCI_DRA7XX
-	bool
+	tristate
 
 config PCI_DRA7XX_HOST
-	bool "TI DRA7xx PCIe controller Host Mode"
+	tristate "TI DRA7xx PCIe controller Host Mode"
 	depends on SOC_DRA7XX || COMPILE_TEST
 	depends on PCI_MSI_IRQ_DOMAIN
 	depends on OF && HAS_IOMEM && TI_PIPE3
@@ -36,7 +36,7 @@ config PCI_DRA7XX_HOST
 	  This uses the DesignWare core.
 
 config PCI_DRA7XX_EP
-	bool "TI DRA7xx PCIe controller Endpoint Mode"
+	tristate "TI DRA7xx PCIe controller Endpoint Mode"
 	depends on SOC_DRA7XX || COMPILE_TEST
 	depends on PCI_ENDPOINT
 	depends on OF && HAS_IOMEM && TI_PIPE3
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 4/5] PCI: dwc: pci-dra7xx: remove unused include
  2021-05-17 15:41 [PATCH 0/5] PCI: dwc: pci-dra7xx: miscellaneous improvements Luca Ceresoli
                   ` (2 preceding siblings ...)
  2021-05-17 15:41 ` [PATCH 3/5] PCI: dwc: pci-dra7xx: allow to build as a loadable module Luca Ceresoli
@ 2021-05-17 15:41 ` Luca Ceresoli
  2021-05-17 15:41 ` [PATCH 5/5] PCI: dwc: pci-dra7xx: get an optional clock Luca Ceresoli
  2021-05-17 16:36 ` [PATCH 0/5] PCI: dwc: pci-dra7xx: miscellaneous improvements Bjorn Helgaas
  5 siblings, 0 replies; 10+ messages in thread
From: Luca Ceresoli @ 2021-05-17 15:41 UTC (permalink / raw)
  To: linux-pci
  Cc: Luca Ceresoli, linux-omap, linux-arm-kernel, linux-kernel,
	Kishon Vijay Abraham I, Lorenzo Pieralisi, Rob Herring,
	Bjorn Helgaas, Jingoo Han, Gustavo Pimentel

Unused since commit e259c2926c01 ("PCI: pci-dra7xx: Prepare for deferred
probe with module_platform_driver").

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 drivers/pci/controller/dwc/pci-dra7xx.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c
index fe11b96fe9a5..05d06806c300 100644
--- a/drivers/pci/controller/dwc/pci-dra7xx.c
+++ b/drivers/pci/controller/dwc/pci-dra7xx.c
@@ -14,7 +14,6 @@
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 5/5] PCI: dwc: pci-dra7xx: get an optional clock
  2021-05-17 15:41 [PATCH 0/5] PCI: dwc: pci-dra7xx: miscellaneous improvements Luca Ceresoli
                   ` (3 preceding siblings ...)
  2021-05-17 15:41 ` [PATCH 4/5] PCI: dwc: pci-dra7xx: remove unused include Luca Ceresoli
@ 2021-05-17 15:41 ` Luca Ceresoli
  2021-05-17 16:36 ` [PATCH 0/5] PCI: dwc: pci-dra7xx: miscellaneous improvements Bjorn Helgaas
  5 siblings, 0 replies; 10+ messages in thread
From: Luca Ceresoli @ 2021-05-17 15:41 UTC (permalink / raw)
  To: linux-pci
  Cc: Luca Ceresoli, linux-omap, linux-arm-kernel, linux-kernel,
	Kishon Vijay Abraham I, Lorenzo Pieralisi, Rob Herring,
	Bjorn Helgaas, Jingoo Han, Gustavo Pimentel

If the clock is provided externally we need to make sure it is enabled
before starting PCI scan.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 drivers/pci/controller/dwc/pci-dra7xx.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c
index 05d06806c300..8dd20b394d0c 100644
--- a/drivers/pci/controller/dwc/pci-dra7xx.c
+++ b/drivers/pci/controller/dwc/pci-dra7xx.c
@@ -7,6 +7,7 @@
  * Authors: Kishon Vijay Abraham I <kishon@ti.com>
  */
 
+#include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/device.h>
 #include <linux/err.h>
@@ -90,6 +91,7 @@ struct dra7xx_pcie {
 	int			phy_count;	/* DT phy-names count */
 	struct phy		**phy;
 	struct irq_domain	*irq_domain;
+	struct clk              *clk;
 	enum dw_pcie_device_mode mode;
 };
 
@@ -744,6 +746,15 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)
 	if (!link)
 		return -ENOMEM;
 
+	dra7xx->clk = devm_clk_get_optional(dev, NULL);
+	if (IS_ERR(dra7xx->clk))
+		return dev_err_probe(dev, PTR_ERR(dra7xx->clk),
+				     "clock request failed");
+
+	ret = clk_prepare_enable(dra7xx->clk);
+	if (ret)
+		return ret;
+
 	for (i = 0; i < phy_count; i++) {
 		snprintf(name, sizeof(name), "pcie-phy%d", i);
 		phy[i] = devm_phy_get(dev, name);
@@ -931,6 +942,8 @@ static void dra7xx_pcie_shutdown(struct platform_device *pdev)
 
 	pm_runtime_disable(dev);
 	dra7xx_pcie_disable_phy(dra7xx);
+
+	clk_disable_unprepare(dra7xx->clk);
 }
 
 static const struct dev_pm_ops dra7xx_pcie_pm_ops = {
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/5] PCI: dwc: pci-dra7xx: miscellaneous improvements
  2021-05-17 15:41 [PATCH 0/5] PCI: dwc: pci-dra7xx: miscellaneous improvements Luca Ceresoli
                   ` (4 preceding siblings ...)
  2021-05-17 15:41 ` [PATCH 5/5] PCI: dwc: pci-dra7xx: get an optional clock Luca Ceresoli
@ 2021-05-17 16:36 ` Bjorn Helgaas
  2021-05-18 17:06   ` Luca Ceresoli
  5 siblings, 1 reply; 10+ messages in thread
From: Bjorn Helgaas @ 2021-05-17 16:36 UTC (permalink / raw)
  To: Luca Ceresoli
  Cc: linux-pci, linux-omap, linux-arm-kernel, linux-kernel,
	Kishon Vijay Abraham I, Lorenzo Pieralisi, Rob Herring,
	Bjorn Helgaas, Jingoo Han, Gustavo Pimentel

On Mon, May 17, 2021 at 05:41:17PM +0200, Luca Ceresoli wrote:
> This is an series of mixed improvements to the DRA7 PCI controller driver:
> allow building as a loadabel module, allow to get and enable a clock and a
> small cleanup.
> 
> Luca
> 
> Luca Ceresoli (5):
>   PCI: dwc: export more symbols to allow modular drivers
>   PCI: dwc: pci-dra7xx: make it a kernel module
>   PCI: dwc: pci-dra7xx: allow to build as a loadable module
>   PCI: dwc: pci-dra7xx: remove unused include
>   PCI: dwc: pci-dra7xx: get an optional clock

This driver has a poor record of subject lines:

  PCI: pci-dra7xx: Prepare for deferred probe with module_platform_driver
  PCI: dwc: Move dw_pcie_setup_rc() to DWC common code
  PCI: dwc/dra7xx: Use the common MSI irq_chip
  PCI: dwc: pci-dra7xx: Fix runtime PM imbalance on error

The "PCI: dwc:" ones are fine -- they apply to the shared dwc core,
not specifically to dra7xx.

The driver-specific ones:

  PCI: pci-dra7xx:
  PCI: dwc/dra7xx:
  PCI: dwc: pci-dra7xx:

are redundant and waste space.  There's no need to mention "dwc" for
dra7xx-specific things, and no need to mention "PCI" twice.

We should use the "PCI: dra7xx:" prefix for things specific to this
driver.

The rest of the subject line should start with a capital letter.  The
subject line should contain specific information when practical.  For
example,

  PCI: dwc: Export dw_pcie_link_up(), dw_pcie_ep_reset_bar() for modular drivers
  PCI: dra7xx: Allow building as module
  PCI: dra7xx: Remove unused linux/init.h include
  PCI: dra7xx: Get optional external clock

I would squash 2/5 and 3/5, similar to a98d2187efd9 ("PCI: meson:
Build as module by default") and 526a76991b7b ("PCI: aardvark:
Implement driver 'remove' function and allow to build it as module").

>  drivers/pci/controller/dwc/Kconfig            |  6 +++---
>  drivers/pci/controller/dwc/pci-dra7xx.c       | 21 +++++++++++++++++--
>  .../pci/controller/dwc/pcie-designware-ep.c   |  1 +
>  drivers/pci/controller/dwc/pcie-designware.c  |  1 +
>  4 files changed, 24 insertions(+), 5 deletions(-)
> 
> -- 
> 2.25.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/5] PCI: dwc: pci-dra7xx: miscellaneous improvements
  2021-05-17 16:36 ` [PATCH 0/5] PCI: dwc: pci-dra7xx: miscellaneous improvements Bjorn Helgaas
@ 2021-05-18 17:06   ` Luca Ceresoli
  0 siblings, 0 replies; 10+ messages in thread
From: Luca Ceresoli @ 2021-05-18 17:06 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, linux-omap, linux-arm-kernel, linux-kernel,
	Kishon Vijay Abraham I, Lorenzo Pieralisi, Rob Herring,
	Bjorn Helgaas, Jingoo Han, Gustavo Pimentel

Bjorn,

On 17/05/21 18:36, Bjorn Helgaas wrote:
> On Mon, May 17, 2021 at 05:41:17PM +0200, Luca Ceresoli wrote:
>> This is an series of mixed improvements to the DRA7 PCI controller driver:
>> allow building as a loadabel module, allow to get and enable a clock and a
>> small cleanup.
>>
>> Luca
>>
>> Luca Ceresoli (5):
>>   PCI: dwc: export more symbols to allow modular drivers
>>   PCI: dwc: pci-dra7xx: make it a kernel module
>>   PCI: dwc: pci-dra7xx: allow to build as a loadable module
>>   PCI: dwc: pci-dra7xx: remove unused include
>>   PCI: dwc: pci-dra7xx: get an optional clock
> 
> This driver has a poor record of subject lines:
> 
>   PCI: pci-dra7xx: Prepare for deferred probe with module_platform_driver
>   PCI: dwc: Move dw_pcie_setup_rc() to DWC common code
>   PCI: dwc/dra7xx: Use the common MSI irq_chip
>   PCI: dwc: pci-dra7xx: Fix runtime PM imbalance on error
> 
> The "PCI: dwc:" ones are fine -- they apply to the shared dwc core,
> not specifically to dra7xx.
> 
> The driver-specific ones:
> 
>   PCI: pci-dra7xx:
>   PCI: dwc/dra7xx:
>   PCI: dwc: pci-dra7xx:
> 
> are redundant and waste space.  There's no need to mention "dwc" for
> dra7xx-specific things, and no need to mention "PCI" twice.
> 
> We should use the "PCI: dra7xx:" prefix for things specific to this
> driver.
> 
> The rest of the subject line should start with a capital letter.  The
> subject line should contain specific information when practical.  For
> example,
> 
>   PCI: dwc: Export dw_pcie_link_up(), dw_pcie_ep_reset_bar() for modular drivers
>   PCI: dra7xx: Allow building as module
>   PCI: dra7xx: Remove unused linux/init.h include
>   PCI: dra7xx: Get optional external clock
> 
> I would squash 2/5 and 3/5, similar to a98d2187efd9 ("PCI: meson:
> Build as module by default") and 526a76991b7b ("PCI: aardvark:
> Implement driver 'remove' function and allow to build it as module").

Thanks for the prompt review. I'll wait a few days for any more comments
and then resend.


-- 
Luca

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/5] PCI: dwc: pci-dra7xx: make it a kernel module
  2021-05-17 15:41 ` [PATCH 2/5] PCI: dwc: pci-dra7xx: make it a kernel module Luca Ceresoli
@ 2021-05-18 18:55   ` Rob Herring
  2021-05-18 21:39     ` Luca Ceresoli
  0 siblings, 1 reply; 10+ messages in thread
From: Rob Herring @ 2021-05-18 18:55 UTC (permalink / raw)
  To: Luca Ceresoli
  Cc: PCI, linux-omap, linux-arm-kernel, linux-kernel,
	Kishon Vijay Abraham I, Lorenzo Pieralisi, Bjorn Helgaas,
	Jingoo Han, Gustavo Pimentel

On Mon, May 17, 2021 at 10:41 AM Luca Ceresoli <luca@lucaceresoli.net> wrote:
>
> This allows to build the driver as a loadable kernel module.

Enable building the driver as a loadable kernel module.

>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> ---
>  drivers/pci/controller/dwc/pci-dra7xx.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c
> index 6457695df00c..fe11b96fe9a5 100644
> --- a/drivers/pci/controller/dwc/pci-dra7xx.c
> +++ b/drivers/pci/controller/dwc/pci-dra7xx.c
> @@ -15,6 +15,7 @@
>  #include <linux/irqdomain.h>
>  #include <linux/kernel.h>
>  #include <linux/init.h>
> +#include <linux/module.h>
>  #include <linux/of_device.h>
>  #include <linux/of_gpio.h>
>  #include <linux/of_pci.h>
> @@ -949,4 +950,8 @@ static struct platform_driver dra7xx_pcie_driver = {
>         },
>         .shutdown = dra7xx_pcie_shutdown,
>  };
> -builtin_platform_driver(dra7xx_pcie_driver);
> +module_platform_driver(dra7xx_pcie_driver);

You need MODULE_DEVICE_TABLE() too for autoloading.

> +
> +MODULE_AUTHOR("Kishon Vijay Abraham I <kishon@ti.com>");
> +MODULE_DESCRIPTION("PCIe controller driver for TI DRA7xx SoCs");
> +MODULE_LICENSE("GPL v2");
> --
> 2.25.1
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/5] PCI: dwc: pci-dra7xx: make it a kernel module
  2021-05-18 18:55   ` Rob Herring
@ 2021-05-18 21:39     ` Luca Ceresoli
  0 siblings, 0 replies; 10+ messages in thread
From: Luca Ceresoli @ 2021-05-18 21:39 UTC (permalink / raw)
  To: Rob Herring
  Cc: PCI, linux-omap, linux-arm-kernel, linux-kernel,
	Kishon Vijay Abraham I, Lorenzo Pieralisi, Bjorn Helgaas,
	Jingoo Han, Gustavo Pimentel

Hi Rob,

On 18/05/21 20:55, Rob Herring wrote:
> On Mon, May 17, 2021 at 10:41 AM Luca Ceresoli <luca@lucaceresoli.net> wrote:
>>
>> This allows to build the driver as a loadable kernel module.
> 
> Enable building the driver as a loadable kernel module.
> 
>>
>> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
>> ---
>>  drivers/pci/controller/dwc/pci-dra7xx.c | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c
>> index 6457695df00c..fe11b96fe9a5 100644
>> --- a/drivers/pci/controller/dwc/pci-dra7xx.c
>> +++ b/drivers/pci/controller/dwc/pci-dra7xx.c
>> @@ -15,6 +15,7 @@
>>  #include <linux/irqdomain.h>
>>  #include <linux/kernel.h>
>>  #include <linux/init.h>
>> +#include <linux/module.h>
>>  #include <linux/of_device.h>
>>  #include <linux/of_gpio.h>
>>  #include <linux/of_pci.h>
>> @@ -949,4 +950,8 @@ static struct platform_driver dra7xx_pcie_driver = {
>>         },
>>         .shutdown = dra7xx_pcie_shutdown,
>>  };
>> -builtin_platform_driver(dra7xx_pcie_driver);
>> +module_platform_driver(dra7xx_pcie_driver);
> 
> You need MODULE_DEVICE_TABLE() too for autoloading.

Good catch! Will be fixed in v2.

Thanks.
-- 
Luca

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-05-18 21:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17 15:41 [PATCH 0/5] PCI: dwc: pci-dra7xx: miscellaneous improvements Luca Ceresoli
2021-05-17 15:41 ` [PATCH 1/5] PCI: dwc: export more symbols to allow modular drivers Luca Ceresoli
2021-05-17 15:41 ` [PATCH 2/5] PCI: dwc: pci-dra7xx: make it a kernel module Luca Ceresoli
2021-05-18 18:55   ` Rob Herring
2021-05-18 21:39     ` Luca Ceresoli
2021-05-17 15:41 ` [PATCH 3/5] PCI: dwc: pci-dra7xx: allow to build as a loadable module Luca Ceresoli
2021-05-17 15:41 ` [PATCH 4/5] PCI: dwc: pci-dra7xx: remove unused include Luca Ceresoli
2021-05-17 15:41 ` [PATCH 5/5] PCI: dwc: pci-dra7xx: get an optional clock Luca Ceresoli
2021-05-17 16:36 ` [PATCH 0/5] PCI: dwc: pci-dra7xx: miscellaneous improvements Bjorn Helgaas
2021-05-18 17:06   ` Luca Ceresoli

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