Skip to contentSkip to conversation

misc: cs5535-mfgpt: Replace 'module_init' with 'module_platform_driver'

PATCH NAK [email protected] 3 participants 4 messages Sep 28, 2013 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 misc: cs5535-mfgpt: Replace 'module_init' with 'module_platform_driver'

From: Elad Wexler <[email protected]>

Driver doesn't do anything special in 'module_init'.

'module_platform_init' makes the code more readable.

---
 drivers/misc/cs5535-mfgpt.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/misc/cs5535-mfgpt.c +1 -7
index effd8c6..abf1a3c 100644
@@ -370,13 +370,7 @@ static struct platform_driver cs5535_mfgpt_driver = {
 	.probe = cs5535_mfgpt_probe,
 };
 
-
-static int __init cs5535_mfgpt_init(void)
-{
-	return platform_driver_register(&cs5535_mfgpt_driver);
-}
-
-module_init(cs5535_mfgpt_init);
+module_platform_driver(cs5535_mfgpt_driver);
 
 MODULE_AUTHOR("Andres Salomon <[email protected]>");
 MODULE_DESCRIPTION("CS5535/CS5536 MFGPT timer driver");
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 7 lines · On Sat, Sep 28, 2013 at 8:14 PM, <[email protected]> wrote:

From: Elad Wexler <[email protected]>

Driver doesn't do anything special in 'module_init'.

'module_platform_init' makes the code more readable.

NAK.

By moving to module_platform_init() you make this module unloadable. Currently it is unloadable for good reasons.
The cs5535-mfgpt chip is nasty because it has no reliable reset function. Therefore by unloading and loading the module again bad things can happen.

Signature · 2 lines
Thanks,
//richard
#2 lore raw
Quoted 7 lines · richard -rw- weinberger
Quoted 6 lines · On Sat, Sep 28, 2013 at 8:14 PM, <[email protected]> wrote:

From: Elad Wexler <[email protected]>

Driver doesn't do anything special in 'module_init'.

'module_platform_init' makes the code more readable.

Quoted 9 lines
Quoted 1 line

NAK.

By moving to module_platform_init() you make this module unloadable. Currently it is unloadable for good reasons.
The cs5535-mfgpt chip is nasty because it has no reliable reset function. Therefore by unloading and loading the module again bad things can happen.

I think this HW information should be well documented. Explaining the reason why it doesn't implemented the 'module_exit'

Quoted 3 lines
Signature · 2 lines
Thanks,
//richard
#3 lore raw

Am 29.09.2013 00:14, schrieb Elad Wexler:

Quoted 12 lines · richard -rw- weinberger
Quoted 11 lines · On Sat, Sep 28, 2013 at 8:14 PM, <[email protected]> wrote:
Quoted 7 lines

From: Elad Wexler <[email protected]>

Driver doesn't do anything special in 'module_init'.

'module_platform_init' makes the code more readable.

NAK.

Quoted 7 lines
Quoted 5 lines

By moving to module_platform_init() you make this module unloadable. Currently it is unloadable for good reasons.
The cs5535-mfgpt chip is nasty because it has no reliable reset function. Therefore by unloading and loading the module again bad things can happen.

I think this HW information should be well documented. Explaining the reason why it doesn't implemented the 'module_exit'

Usually if a driver does not implement the exit function it's because of hardware limitations.
IOW, the alarm bell rings. ;-)

Thanks,
//richard