Skip to contentSkip to conversation

Revert "mtd: bcm47xxnflash: Use module_platform_driver"

RFC New Rafał Miłecki 1 participant 1 message Feb 23, 2014

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

RFC 1/3 Revert "mtd: bcm47xxnflash: Use module_platform_driver"

This reverts commit 994bbd0e91c0dfa4dcda9097b0716607aeec5470.

We're going to add support for more NAND flashes and the new ones are not registered as platform devices. So we need our own init function.

---
 drivers/mtd/nand/bcm47xxnflash/main.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
drivers/mtd/nand/bcm47xxnflash/main.c +19 -1
index 1074459..52611ef 100644
@@ -77,4 +77,22 @@ static struct platform_driver bcm47xxnflash_driver = {
 	},
 };
 
-module_platform_driver(bcm47xxnflash_driver);
+static int __init bcm47xxnflash_init(void)
+{
+	int err;
+
+	err = platform_driver_register(&bcm47xxnflash_driver);
+	if (err)
+		pr_err("Failed to register bcm47xx nand flash driver: %d\n",
+		       err);
+
+	return err;
+}
+
+static void __exit bcm47xxnflash_exit(void)
+{
+	platform_driver_unregister(&bcm47xxnflash_driver);
+}
+
+module_init(bcm47xxnflash_init);
+module_exit(bcm47xxnflash_exit);
Signature · 1 line
1.8.4.5