Skip to contentSkip to conversation

pci: meson: build as module by default

PATCH Applied Kevin Hilman 4 participants 6 messages Sep 18, 2020 – Oct 5, 2020

Subsystems (4)
lore
Share & tools
lore

Kevin Hilman

author maintainer
#0 lore raw

PATCH 1/1 pci: meson: build as module by default

Enable pci-meson to build as a module whenever ARCH_MESON is enabled.

---
Tested on Khadas VIM3 and Khadas VIM3 using NVMe SSD devices.

 drivers/pci/controller/dwc/Kconfig     | 3 ++-
 drivers/pci/controller/dwc/pci-meson.c | 8 +++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/Kconfig +2 -1
index 044a3761c44f..bc049865f8e0 100644
@@ -237,8 +237,9 @@ config PCIE_HISI_STB
 	  Say Y here if you want PCIe controller support on HiSilicon STB SoCs
 
 config PCI_MESON
-	bool "MESON PCIe controller"
+	tristate "MESON PCIe controller"
 	depends on PCI_MSI_IRQ_DOMAIN
+	default m if ARCH_MESON
 	select PCIE_DW_HOST
 	help
 	  Say Y here if you want to enable PCI controller support on Amlogic
drivers/pci/controller/dwc/pci-meson.c +7 -1
index 4f183b96afbb..7a1fb55ee44a 100644
@@ -17,6 +17,7 @@
 #include <linux/resource.h>
 #include <linux/types.h>
 #include <linux/phy/phy.h>
+#include <linux/module.h>
 
 #include "pcie-designware.h"
 
@@ -589,6 +590,7 @@ static const struct of_device_id meson_pcie_of_match[] = {
 	},
 	{},
 };
+MODULE_DEVICE_TABLE(of, meson_pcie_of_match);
 
 static struct platform_driver meson_pcie_driver = {
 	.probe = meson_pcie_probe,
@@ -598,4 +600,8 @@ static struct platform_driver meson_pcie_driver = {
 	},
 };
 
-builtin_platform_driver(meson_pcie_driver);
+module_platform_driver(meson_pcie_driver);
+
+MODULE_AUTHOR("Yue Wang <[email protected]>");
+MODULE_DESCRIPTION("Amlogic PCIe Controller driver");
+MODULE_LICENSE("Dual BSD/GPL");
Signature · 1 line
2.28.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 48 lines · Kevin Hilman

Enable pci-meson to build as a module whenever ARCH_MESON is enabled.

---
Tested on Khadas VIM3 and Khadas VIM3 using NVMe SSD devices.

 drivers/pci/controller/dwc/Kconfig     | 3 ++-
 drivers/pci/controller/dwc/pci-meson.c | 8 +++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/Kconfig +2 -1
index 044a3761c44f..bc049865f8e0 100644
@@ -237,8 +237,9 @@ config PCIE_HISI_STB
 	  Say Y here if you want PCIe controller support on HiSilicon STB SoCs
 
 config PCI_MESON
-	bool "MESON PCIe controller"
+	tristate "MESON PCIe controller"
 	depends on PCI_MSI_IRQ_DOMAIN
+	default m if ARCH_MESON
 	select PCIE_DW_HOST
 	help
 	  Say Y here if you want to enable PCI controller support on Amlogic
drivers/pci/controller/dwc/pci-meson.c +2 -0
index 4f183b96afbb..7a1fb55ee44a 100644
@@ -17,6 +17,7 @@
 #include <linux/resource.h>
 #include <linux/types.h>
 #include <linux/phy/phy.h>
+#include <linux/module.h>
 
 #include "pcie-designware.h"
 
@@ -589,6 +590,7 @@ static const struct of_device_id meson_pcie_of_match[] = {
 	},
 	{},
 };
+MODULE_DEVICE_TABLE(of, meson_pcie_of_match);
 
 static struct platform_driver meson_pcie_driver = {
 	.probe = meson_pcie_probe,

drivers/pci/controller/dwc/pci-meson.c static struct platform_driver meson_pcie_driver = { · line 607

Quoted 9 lines
drivers/pci/controller/dwc/pci-meson.c +5 -1
@@ -598,4 +600,8 @@ static struct platform_driver meson_pcie_driver = {
 	},
 };
 
-builtin_platform_driver(meson_pcie_driver);
+module_platform_driver(meson_pcie_driver);
+
+MODULE_AUTHOR("Yue Wang <[email protected]>");
+MODULE_DESCRIPTION("Amlogic PCIe Controller driver");
+MODULE_LICENSE("Dual BSD/GPL");
reviewer
#2 lore raw
In reply to Kevin Hilman
Quoted 39 lines · Kevin Hilman

Enable pci-meson to build as a module whenever ARCH_MESON is enabled.

---
Tested on Khadas VIM3 and Khadas VIM3 using NVMe SSD devices.

 drivers/pci/controller/dwc/Kconfig     | 3 ++-
 drivers/pci/controller/dwc/pci-meson.c | 8 +++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/Kconfig +2 -1
index 044a3761c44f..bc049865f8e0 100644
@@ -237,8 +237,9 @@ config PCIE_HISI_STB
 	  Say Y here if you want PCIe controller support on HiSilicon STB SoCs
 
 config PCI_MESON
-	bool "MESON PCIe controller"
+	tristate "MESON PCIe controller"
 	depends on PCI_MSI_IRQ_DOMAIN
+	default m if ARCH_MESON
 	select PCIE_DW_HOST
 	help
 	  Say Y here if you want to enable PCI controller support on Amlogic
drivers/pci/controller/dwc/pci-meson.c +1 -0
index 4f183b96afbb..7a1fb55ee44a 100644
@@ -17,6 +17,7 @@
 #include <linux/resource.h>
 #include <linux/types.h>
 #include <linux/phy/phy.h>
+#include <linux/module.h>
 
 #include "pcie-designware.h"
 

drivers/pci/controller/dwc/pci-meson.c static const struct of_device_id meson_pcie_of_match[] = { · line 596

Quoted 7 lines
drivers/pci/controller/dwc/pci-meson.c +1 -0
@@ -589,6 +590,7 @@ static const struct of_device_id meson_pcie_of_match[] = {
 	},
 	{},
 };
+MODULE_DEVICE_TABLE(of, meson_pcie_of_match);
 
 static struct platform_driver meson_pcie_driver = {
 	.probe = meson_pcie_probe,

You need a remove hook to tear down the PCI bus at least.

Really I'd like to add a devres hook in pci_host_probe to do that for all the drivers.

drivers/pci/controller/dwc/pci-meson.c static struct platform_driver meson_pcie_driver = { · line 607

Quoted 10 lines
drivers/pci/controller/dwc/pci-meson.c +5 -1
@@ -598,4 +600,8 @@ static struct platform_driver meson_pcie_driver = {
 	},
 };
 
-builtin_platform_driver(meson_pcie_driver);
+module_platform_driver(meson_pcie_driver);
+
+MODULE_AUTHOR("Yue Wang <[email protected]>");
+MODULE_DESCRIPTION("Amlogic PCIe Controller driver");
+MODULE_LICENSE("Dual BSD/GPL");

First line is: SPDX-License-Identifier: GPL-2.0

Quoted 8 lines
Signature · 7 lines
2.28.0


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
#3 lore raw
In reply to Kevin Hilman
Quoted 10 lines · Kevin Hilman

Enable pci-meson to build as a module whenever ARCH_MESON is enabled.

---
Tested on Khadas VIM3 and Khadas VIM3 using NVMe SSD devices.

 drivers/pci/controller/dwc/Kconfig     | 3 ++-
 drivers/pci/controller/dwc/pci-meson.c | 8 +++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

Applied to pci/meson, thanks.

Lorenzo

Quoted 48 lines
drivers/pci/controller/dwc/Kconfig +2 -1
index 044a3761c44f..bc049865f8e0 100644
@@ -237,8 +237,9 @@ config PCIE_HISI_STB
 	  Say Y here if you want PCIe controller support on HiSilicon STB SoCs
 
 config PCI_MESON
-	bool "MESON PCIe controller"
+	tristate "MESON PCIe controller"
 	depends on PCI_MSI_IRQ_DOMAIN
+	default m if ARCH_MESON
 	select PCIE_DW_HOST
 	help
 	  Say Y here if you want to enable PCI controller support on Amlogic
drivers/pci/controller/dwc/pci-meson.c +7 -1
index 4f183b96afbb..7a1fb55ee44a 100644
@@ -17,6 +17,7 @@
 #include <linux/resource.h>
 #include <linux/types.h>
 #include <linux/phy/phy.h>
+#include <linux/module.h>
 
 #include "pcie-designware.h"
 
@@ -589,6 +590,7 @@ static const struct of_device_id meson_pcie_of_match[] = {
 	},
 	{},
 };
+MODULE_DEVICE_TABLE(of, meson_pcie_of_match);
 
 static struct platform_driver meson_pcie_driver = {
 	.probe = meson_pcie_probe,
@@ -598,4 +600,8 @@ static struct platform_driver meson_pcie_driver = {
 	},
 };
 
-builtin_platform_driver(meson_pcie_driver);
+module_platform_driver(meson_pcie_driver);
+
+MODULE_AUTHOR("Yue Wang <[email protected]>");
+MODULE_DESCRIPTION("Amlogic PCIe Controller driver");
+MODULE_LICENSE("Dual BSD/GPL");
Signature · 1 line
2.28.0
author maintainer
#4 lore raw

Hi Lorenzo,

Quoted 8 lines · Lorenzo Pieralisi
Quoted 7 lines · Kevin Hilman

Enable pci-meson to build as a module whenever ARCH_MESON is enabled.

---
Tested on Khadas VIM3 and Khadas VIM3 using NVMe SSD devices.

Quoted 5 lines
Quoted 3 lines
 drivers/pci/controller/dwc/Kconfig     | 3 ++-
 drivers/pci/controller/dwc/pci-meson.c | 8 +++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

Applied to pci/meson, thanks.

Rob pointed out that the MODULE_LICENCE wasn't the same as the SPDX header. Could you squash the update below before submitting?

Thanks,

Kevin

drivers/pci/controller/dwc/pci-meson.c +1 -1
index 7a1fb55ee44a..35b167e907aa 100644
@@ -604,4 +604,4 @@ module_platform_driver(meson_pcie_driver);
 
 MODULE_AUTHOR("Yue Wang <[email protected]>");
 MODULE_DESCRIPTION("Amlogic PCIe Controller driver");
-MODULE_LICENSE("Dual BSD/GPL");
+MODULE_LICENSE("GPL v2");
#5 lore raw
Quoted 12 lines · Kevin Hilman

Hi Lorenzo,

Quoted 8 lines · Lorenzo Pieralisi
Quoted 7 lines · Kevin Hilman

Enable pci-meson to build as a module whenever ARCH_MESON is enabled.

---
Tested on Khadas VIM3 and Khadas VIM3 using NVMe SSD devices.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
 drivers/pci/controller/dwc/Kconfig     | 3 ++-
 drivers/pci/controller/dwc/pci-meson.c | 8 +++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

Applied to pci/meson, thanks.

Rob pointed out that the MODULE_LICENCE wasn't the same as the SPDX header. Could you squash the update below before submitting?

Hi Kevin,

done thanks.

Lorenzo