Skip to contentSkip to conversation

watchdog: pcwd: Utilize the module_isa_driver macro

PATCH In review William Breathitt Gray 3 participants 3 messages Jun 1, 2016 – Jul 17, 2016 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: pcwd: Utilize the module_isa_driver macro

This driver does not do anything special in module init/exit. This patch eliminates the module init/exit boilerplate code by utilizing the module_isa_driver macro.

---
 drivers/watchdog/pcwd.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/watchdog/pcwd.c +1 -13
index e936f15..3ad5206 100644
@@ -992,19 +992,7 @@ static struct isa_driver pcwd_isa_driver = {
 	},
 };
 
-static int __init pcwd_init_module(void)
-{
-	return isa_register_driver(&pcwd_isa_driver, PCWD_ISA_NR_CARDS);
-}
-
-static void __exit pcwd_cleanup_module(void)
-{
-	isa_unregister_driver(&pcwd_isa_driver);
-	pr_info("Watchdog Module Unloaded\n");
-}
-
-module_init(pcwd_init_module);
-module_exit(pcwd_cleanup_module);
+module_isa_driver(pcwd_isa_driver, PCWD_ISA_NR_CARDS);
 
 MODULE_AUTHOR("Ken Hollis <[email protected]>, "
 		"Wim Van Sebroeck <[email protected]>");
Signature · 1 line
2.7.3
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · William Breathitt Gray

This driver does not do anything special in module init/exit. This patch eliminates the module init/exit boilerplate code by utilizing the module_isa_driver macro.

Quoted 30 lines
---
  drivers/watchdog/pcwd.c | 14 +-------------
  1 file changed, 1 insertion(+), 13 deletions(-)
drivers/watchdog/pcwd.c +1 -13
index e936f15..3ad5206 100644
@@ -992,19 +992,7 @@ static struct isa_driver pcwd_isa_driver = {
  	},
  };
 
-static int __init pcwd_init_module(void)
-{
-	return isa_register_driver(&pcwd_isa_driver, PCWD_ISA_NR_CARDS);
-}
-
-static void __exit pcwd_cleanup_module(void)
-{
-	isa_unregister_driver(&pcwd_isa_driver);
-	pr_info("Watchdog Module Unloaded\n");
-}
-
-module_init(pcwd_init_module);
-module_exit(pcwd_cleanup_module);
+module_isa_driver(pcwd_isa_driver, PCWD_ISA_NR_CARDS);
 
  MODULE_AUTHOR("Ken Hollis <[email protected]>, "
  		"Wim Van Sebroeck <[email protected]>");
#2 lore raw
In reply to William Breathitt Gray

Hi William,

Quoted 37 lines

This driver does not do anything special in module init/exit. This patch eliminates the module init/exit boilerplate code by utilizing the module_isa_driver macro.

---
 drivers/watchdog/pcwd.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/watchdog/pcwd.c +1 -13
index e936f15..3ad5206 100644
@@ -992,19 +992,7 @@ static struct isa_driver pcwd_isa_driver = {
 	},
 };
 
-static int __init pcwd_init_module(void)
-{
-	return isa_register_driver(&pcwd_isa_driver, PCWD_ISA_NR_CARDS);
-}
-
-static void __exit pcwd_cleanup_module(void)
-{
-	isa_unregister_driver(&pcwd_isa_driver);
-	pr_info("Watchdog Module Unloaded\n");
-}
-
-module_init(pcwd_init_module);
-module_exit(pcwd_cleanup_module);
+module_isa_driver(pcwd_isa_driver, PCWD_ISA_NR_CARDS);
 
 MODULE_AUTHOR("Ken Hollis <[email protected]>, "
 		"Wim Van Sebroeck <[email protected]>");
Signature · 1 line
2.7.3

This patch has been added to linux-watchdog-next.

Kind regards,
Wim.