Skip to contentSkip to conversation

mmc: cavium-octeon: Convert to use module_platform_driver

PATCH Applied Axel Lin 3 participants 3 messages Aug 19, 2017 – Aug 22, 2017

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 mmc: cavium-octeon: Convert to use module_platform_driver

Get rid of boilerplate code by using module_platform_driver macro.

---
 drivers/mmc/host/cavium-octeon.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/mmc/host/cavium-octeon.c +1 -12
index 951d2cd..22aded1 100644
@@ -342,18 +342,7 @@ static struct platform_driver octeon_mmc_driver = {
 	},
 };
 
-static int __init octeon_mmc_init(void)
-{
-	return platform_driver_register(&octeon_mmc_driver);
-}
-
-static void __exit octeon_mmc_cleanup(void)
-{
-	platform_driver_unregister(&octeon_mmc_driver);
-}
-
-module_init(octeon_mmc_init);
-module_exit(octeon_mmc_cleanup);
+module_platform_driver(octeon_mmc_driver);
 
 MODULE_AUTHOR("Cavium Inc. <[email protected]>");
 MODULE_DESCRIPTION("Low-level driver for Cavium OCTEON MMC/SSD card");
Signature · 1 line
2.9.3
Acked-by on v1 1/1
#1 lore raw
Quoted 1 line · Axel Lin

Get rid of boilerplate code by using module_platform_driver macro.

Looks good. If you want to add:

thanks, Jan

Quoted 31 lines
---
 drivers/mmc/host/cavium-octeon.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/mmc/host/cavium-octeon.c +1 -12
index 951d2cd..22aded1 100644
@@ -342,18 +342,7 @@ static struct platform_driver octeon_mmc_driver = {
 	},
 };
 
-static int __init octeon_mmc_init(void)
-{
-	return platform_driver_register(&octeon_mmc_driver);
-}
-
-static void __exit octeon_mmc_cleanup(void)
-{
-	platform_driver_unregister(&octeon_mmc_driver);
-}
-
-module_init(octeon_mmc_init);
-module_exit(octeon_mmc_cleanup);
+module_platform_driver(octeon_mmc_driver);
 
 MODULE_AUTHOR("Cavium Inc. <[email protected]>");
 MODULE_DESCRIPTION("Low-level driver for Cavium OCTEON MMC/SSD card");
Signature · 1 line
2.9.3
Applied
#2 lore raw
In reply to Axel Lin
Quoted 3 lines · Axel Lin

Get rid of boilerplate code by using module_platform_driver macro.

Thanks, applied for next!

Kind regards
Uffe

Quoted 31 lines
---
 drivers/mmc/host/cavium-octeon.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/mmc/host/cavium-octeon.c +1 -13
index 951d2cd..22aded1 100644
@@ -342,18 +342,7 @@ static struct platform_driver octeon_mmc_driver = {
        },
 };
 
-static int __init octeon_mmc_init(void)
-{
-       return platform_driver_register(&octeon_mmc_driver);
-}
-
-static void __exit octeon_mmc_cleanup(void)
-{
-       platform_driver_unregister(&octeon_mmc_driver);
-}
-
-module_init(octeon_mmc_init);
-module_exit(octeon_mmc_cleanup);
+module_platform_driver(octeon_mmc_driver);
 
 MODULE_AUTHOR("Cavium Inc. <[email protected]>");
 MODULE_DESCRIPTION("Low-level driver for Cavium OCTEON MMC/SSD card");
--

2.9.3