diff mbox series

[2/4] mtd: rawnand: txx9ndfmc: Switch to module_platform_driver()

Message ID 20231102220246.3336154-8-u.kleine-koenig@pengutronix.de
State Accepted
Headers show
Series mtd: Convert to platform remove callback returning (part II) | expand

Commit Message

Uwe Kleine-König Nov. 2, 2023, 10:02 p.m. UTC
While module_platform_driver_probe() offers the possibility to discard
.probe() and .remove() in some situations, the handling is difficult and
in today's systems the few hundred bytes that can be saved have little
importance. So convert the driver to be a normal driver that can be
bound and unbound at runtime as most other drivers, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/mtd/nand/raw/txx9ndfmc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Miquel Raynal Nov. 13, 2023, 11:12 a.m. UTC | #1
On Thu, 2023-11-02 at 22:02:49 UTC, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= wrote:
> While module_platform_driver_probe() offers the possibility to discard
> .probe() and .remove() in some situations, the handling is difficult and
> in today's systems the few hundred bytes that can be saved have little
> importance. So convert the driver to be a normal driver that can be
> bound and unbound at runtime as most other drivers, too.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel
diff mbox series

Patch

diff --git a/drivers/mtd/nand/raw/txx9ndfmc.c b/drivers/mtd/nand/raw/txx9ndfmc.c
index eddcc0728a67..9d6c62f73bb7 100644
--- a/drivers/mtd/nand/raw/txx9ndfmc.c
+++ b/drivers/mtd/nand/raw/txx9ndfmc.c
@@ -276,7 +276,7 @@  static const struct nand_controller_ops txx9ndfmc_controller_ops = {
 	.attach_chip = txx9ndfmc_attach_chip,
 };
 
-static int __init txx9ndfmc_probe(struct platform_device *dev)
+static int txx9ndfmc_probe(struct platform_device *dev)
 {
 	struct txx9ndfmc_platform_data *plat = dev_get_platdata(&dev->dev);
 	int hold, spw;
@@ -369,7 +369,7 @@  static int __init txx9ndfmc_probe(struct platform_device *dev)
 	return 0;
 }
 
-static int __exit txx9ndfmc_remove(struct platform_device *dev)
+static int txx9ndfmc_remove(struct platform_device *dev)
 {
 	struct txx9ndfmc_drvdata *drvdata = platform_get_drvdata(dev);
 	int ret, i;
@@ -407,14 +407,14 @@  static int txx9ndfmc_resume(struct platform_device *dev)
 #endif
 
 static struct platform_driver txx9ndfmc_driver = {
-	.remove		= __exit_p(txx9ndfmc_remove),
+	.probe		= txx9ndfmc_probe,
+	.remove		= txx9ndfmc_remove,
 	.resume		= txx9ndfmc_resume,
 	.driver		= {
 		.name	= "txx9ndfmc",
 	},
 };
-
-module_platform_driver_probe(txx9ndfmc_driver, txx9ndfmc_probe);
+module_platform_driver(txx9ndfmc_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("TXx9 SoC NAND flash controller driver");