Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: rawnand: sh_flctl: Convert to module_platform_driver()

The driver doesn't benefit from the advantages that
module_platform_driver_probe() allows (i.e. putting the probe function
in .init.text and the .remove function into .exit.text).
So use module_platform_driver() instead which allows to bind the driver
also after booting (or module loading) and unbinding via sysfs.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20231016103540.1566865-2-u.kleine-koenig@pengutronix.de

authored by

Uwe Kleine-König and committed by
Miquel Raynal
60ec53ac 6dc59740

+2 -1
+2 -1
drivers/mtd/nand/raw/sh_flctl.c
··· 1215 1215 } 1216 1216 1217 1217 static struct platform_driver flctl_driver = { 1218 + .probe = flctl_probe, 1218 1219 .remove_new = flctl_remove, 1219 1220 .driver = { 1220 1221 .name = "sh_flctl", ··· 1223 1222 }, 1224 1223 }; 1225 1224 1226 - module_platform_driver_probe(flctl_driver, flctl_probe); 1225 + module_platform_driver(flctl_driver); 1227 1226 1228 1227 MODULE_LICENSE("GPL v2"); 1229 1228 MODULE_AUTHOR("Yoshihiro Shimoda");