mtd: bcm47: convert to module_platform_driver instead of init/exit
PATCH RESEND 2/2 mtd: bcm47: convert to module_platform_driver instead of init/exit
convert to module_platform_driver instead of init/exit
--- drivers/mtd/devices/bcm47xxsflash.c | 20 +------------------- 1 files changed, 1 insertions(+), 19 deletions(-)
drivers/mtd/devices/bcm47xxsflash.c +1 -19
@@ -108,22 +108,4 @@ static struct platform_driver bcma_sflash_driver = {* Init **************************************************/ -static int __init bcm47xxsflash_init (void ) -{ -int err; - - err =platform_driver_register (&bcma_sflash_driver); -if (err) -pr_err ("Failed to register BCMA serial flash driver: %d\n" , - err); - -return err; -} - -static void __exit bcm47xxsflash_exit(void) -{ -platform_driver_unregister (&bcma_sflash_driver); -} - -module_init (bcm47xxsflash_init); -module_exit (bcm47xxsflash_exit); +module_platform_driver (bcma_sflash_driver);
Signature · 1 line
1.7.1
Quoted 2 lines · Libo Chen
convert to
module_platform_driverinstead of init/exit
I give another thought about it. We have to be sure that the flash device will be online when it's really needed.module_init initcall is quite far in the boot process. Is it what we want?
Quoted 27 lines
drivers/mtd/devices/bcm47xxsflash.c +1
-20@@ -108,22 +108,4 @@ static struct platform_driver bcma_sflash_driver = {* Init **************************************************/ -static int __init bcm47xxsflash_init (void ) -{ -int err; - - err =platform_driver_register (&bcma_sflash_driver); -if (err) -pr_err ("Failed to register BCMA serial flash driver: %d\n" , - err); - -return err; -} - -static void __exit bcm47xxsflash_exit(void) -{ -platform_driver_unregister (&bcma_sflash_driver); -} - -module_init (bcm47xxsflash_init); -module_exit (bcm47xxsflash_exit); +module_platform_driver (bcma_sflash_driver); --
Quoted 3 lines
1.7.1
--
With Best Regards,
Andy Shevchenko
Quoted 7 lines · Andy Shevchenko
Quoted 2 lines · Libo Chen
convert to
module_platform_driverinstead of init/exitI give another thought about it. We have to be sure that the flash device will be online when it's really needed.
module_initinitcall is quite far in the boot process. Is it what we want?
This is no problem, the flash driver is needed when the root file system is mounted. The arch code reads the SoC configuration values in its own code in arch/mips/bcm47xx/nvram.c without using the mtd subsystem. These values are needed very early in the boot process.
Hauke