Skip to contentSkip to conversation

PCI: altera-msi: Convert to subsys_platform_driver()

PATCH Applied Peng Fan (OSS) 4 participants 4 messages Nov 4 – Nov 5

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

PATCH 1/1 PCI: altera-msi: Convert to subsys_platform_driver()

From: Peng Fan <[email protected]>

Replace the open-coded subsys_initcall()/module_exit() platform driver registration with subsys_platform_driver().

No functional change.

---
 drivers/pci/controller/pcie-altera-msi.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/pci/controller/pcie-altera-msi.c +1 -12
index ea2ca2e70f20..8c0696cbd4ae 100644
@@ -267,18 +267,7 @@ static struct platform_driver altera_msi_driver = {
 	.remove = altera_msi_remove,
 };
 
-static int __init altera_msi_init(void)
-{
-	return platform_driver_register(&altera_msi_driver);
-}
-
-static void __exit altera_msi_exit(void)
-{
-	platform_driver_unregister(&altera_msi_driver);
-}
-
-subsys_initcall(altera_msi_init);
+subsys_platform_driver(altera_msi_driver);
 MODULE_DEVICE_TABLE(of, altera_msi_of_match);
-module_exit(altera_msi_exit);
 MODULE_DESCRIPTION("Altera PCIe MSI support driver");
 MODULE_LICENSE("GPL v2");
Signature · 1 line
2.51.0
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 8 lines

From: Peng Fan <[email protected]>

Replace the open-coded subsys_initcall()/module_exit() platform driver registration with subsys_platform_driver().

No functional change.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer Applied
#2 lore raw
In reply to Peng Fan (OSS)
Quoted 1 line · Peng Fan (OSS)

PCI: altera-msi: Convert to subsys_platform_driver()

Applied, thanks!

[1/1] PCI: altera-msi: Convert to subsys_platform_driver()

      commit: e5b8af7c98f184590b82d505f8ade025ba7cafae

Best regards,

Signature · 1 line
மணிவண்ணன் சதாசிவம்
#3 lore raw
In reply to Peng Fan (OSS)

[+cc Altera, X-Gene folks]

Quoted 26 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Replace the open-coded subsys_initcall()/module_exit() platform driver registration with subsys_platform_driver().

No functional change.

---
 drivers/pci/controller/pcie-altera-msi.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/pci/controller/pcie-altera-msi.c +0 -6
index ea2ca2e70f20..8c0696cbd4ae 100644
@@ -267,18 +267,7 @@ static struct platform_driver altera_msi_driver = {
 	.remove = altera_msi_remove,
 };
 
-static int __init altera_msi_init(void)
-{
-	return platform_driver_register(&altera_msi_driver);
-}
-
-static void __exit altera_msi_exit(void)

drivers/pci/controller/pcie-altera-msi.c static struct platform_driver altera_msi_driver = { · line 273

Quoted 10 lines
drivers/pci/controller/pcie-altera-msi.c +1 -6
-{
-	platform_driver_unregister(&altera_msi_driver);
-}
-
-subsys_initcall(altera_msi_init);
+subsys_platform_driver(altera_msi_driver);
 MODULE_DEVICE_TABLE(of, altera_msi_of_match);
-module_exit(altera_msi_exit);
 MODULE_DESCRIPTION("Altera PCIe MSI support driver");
 MODULE_LICENSE("GPL v2");

Looks like a nice improvement.

There are only three drivers that have separate MSI Kconfig options and separate -msi.c files: altera, iproc, and xgene.

pcie-iproc-msi.c doesn't look like it has its own DT .compatible string and driver registration stuff, but altera and xgene do. I wonder if it's possible to integrate them into the main drivers so we don't need separate Kconfig and separate .c files?