Skip to contentSkip to conversation

spi: use module_pci_driver

PATCH Applied Axel Lin 2 participants 2 messages Apr 4, 2012 – Apr 5, 2012

Subsystems (3)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 spi: use module_pci_driver

This patch converts the drivers in drivers/spi/* to use module_pci_driver() macro which makes the code smaller and a bit simpler.

---
 drivers/spi/spi-dw-pci.c     |   13 +------------
 drivers/spi/spi-pxa2xx-pci.c |   12 +-----------
 2 files changed, 2 insertions(+), 23 deletions(-)
drivers/spi/spi-dw-pci.c +1 -12
index 14f7cc9..ff81abb 100644
@@ -164,18 +164,7 @@ static struct pci_driver dw_spi_driver = {
 	.resume	=	spi_resume,
 };
 
-static int __init mrst_spi_init(void)
-{
-	return pci_register_driver(&dw_spi_driver);
-}
-
-static void __exit mrst_spi_exit(void)
-{
-	pci_unregister_driver(&dw_spi_driver);
-}
-
-module_init(mrst_spi_init);
-module_exit(mrst_spi_exit);
+module_pci_driver(dw_spi_driver);
 
 MODULE_AUTHOR("Feng Tang <[email protected]>");
 MODULE_DESCRIPTION("PCI interface driver for DW SPI Core");
drivers/spi/spi-pxa2xx-pci.c +1 -11
index 3fb44af..9f6ba34 100644
@@ -164,17 +164,7 @@ static struct pci_driver ce4100_spi_driver = {
 	.remove         = __devexit_p(ce4100_spi_remove),
 };
 
-static int __init ce4100_spi_init(void)
-{
-	return pci_register_driver(&ce4100_spi_driver);
-}
-module_init(ce4100_spi_init);
-
-static void __exit ce4100_spi_exit(void)
-{
-	pci_unregister_driver(&ce4100_spi_driver);
-}
-module_exit(ce4100_spi_exit);
+module_pci_driver(ce4100_spi_driver);
 
 MODULE_DESCRIPTION("CE4100 PCI-SPI glue code for PXA's driver");
 MODULE_LICENSE("GPL v2");
Signature · 1 line
1.7.5.4
Applied
#1 lore raw
Quoted 4 lines · Axel Lin

This patch converts the drivers in drivers/spi/* to use module_pci_driver() macro which makes the code smaller and a bit simpler.

Applied, thanks.

g.

Quoted 57 lines
---
 drivers/spi/spi-dw-pci.c     |   13 +------------
 drivers/spi/spi-pxa2xx-pci.c |   12 +-----------
 2 files changed, 2 insertions(+), 23 deletions(-)
drivers/spi/spi-dw-pci.c +1 -12
index 14f7cc9..ff81abb 100644
@@ -164,18 +164,7 @@ static struct pci_driver dw_spi_driver = {
 	.resume	=	spi_resume,
 };
 
-static int __init mrst_spi_init(void)
-{
-	return pci_register_driver(&dw_spi_driver);
-}
-
-static void __exit mrst_spi_exit(void)
-{
-	pci_unregister_driver(&dw_spi_driver);
-}
-
-module_init(mrst_spi_init);
-module_exit(mrst_spi_exit);
+module_pci_driver(dw_spi_driver);
 
 MODULE_AUTHOR("Feng Tang <[email protected]>");
 MODULE_DESCRIPTION("PCI interface driver for DW SPI Core");
drivers/spi/spi-pxa2xx-pci.c +1 -11
index 3fb44af..9f6ba34 100644
@@ -164,17 +164,7 @@ static struct pci_driver ce4100_spi_driver = {
 	.remove         = __devexit_p(ce4100_spi_remove),
 };
 
-static int __init ce4100_spi_init(void)
-{
-	return pci_register_driver(&ce4100_spi_driver);
-}
-module_init(ce4100_spi_init);
-
-static void __exit ce4100_spi_exit(void)
-{
-	pci_unregister_driver(&ce4100_spi_driver);
-}
-module_exit(ce4100_spi_exit);
+module_pci_driver(ce4100_spi_driver);
 
 MODULE_DESCRIPTION("CE4100 PCI-SPI glue code for PXA's driver");
 MODULE_LICENSE("GPL v2");
Signature · 1 line
1.7.5.4
Signature · 8 lines
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev