diff mbox series

[2/2] mtd/rawnand: ingenic-nand: Make probe function __init_or_module

Message ID 20190607160200.16052-2-paul@crapouillou.net
State Rejected
Delegated to: Miquel Raynal
Headers show
Series [1/2] mtd/rawnand: ingenic-ecc: Make probe function __init_or_module | expand

Commit Message

Paul Cercueil June 7, 2019, 4:02 p.m. UTC
This allows the probe function to be dropped after the kernel finished
its initialization, in the case where the driver was not compiled as a
module.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/mtd/nand/raw/ingenic/ingenic_nand.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_nand.c b/drivers/mtd/nand/raw/ingenic/ingenic_nand.c
index d7b7c0f13909..b7f2facb4b37 100644
--- a/drivers/mtd/nand/raw/ingenic/ingenic_nand.c
+++ b/drivers/mtd/nand/raw/ingenic/ingenic_nand.c
@@ -302,7 +302,7 @@  static const struct nand_controller_ops ingenic_nand_controller_ops = {
 	.attach_chip = ingenic_nand_attach_chip,
 };
 
-static int ingenic_nand_init_chip(struct platform_device *pdev,
+static int __init_or_module ingenic_nand_init_chip(struct platform_device *pdev,
 				  struct ingenic_nfc *nfc,
 				  struct device_node *np,
 				  unsigned int chipnr)
@@ -399,7 +399,7 @@  static void ingenic_nand_cleanup_chips(struct ingenic_nfc *nfc)
 	}
 }
 
-static int ingenic_nand_init_chips(struct ingenic_nfc *nfc,
+static int __init_or_module ingenic_nand_init_chips(struct ingenic_nfc *nfc,
 				   struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -427,7 +427,7 @@  static int ingenic_nand_init_chips(struct ingenic_nfc *nfc,
 	return 0;
 }
 
-static int ingenic_nand_probe(struct platform_device *pdev)
+static int __init_or_module ingenic_nand_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	unsigned int num_banks;
@@ -473,7 +473,7 @@  static int ingenic_nand_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int ingenic_nand_remove(struct platform_device *pdev)
+static int __exit ingenic_nand_remove(struct platform_device *pdev)
 {
 	struct ingenic_nfc *nfc = platform_get_drvdata(pdev);