radio: Utilize the module_isa_driver macro
cover radio: Utilize the module_isa_driver macro
The module_isa_driver macro is a helper macro for ISA drivers which do not do anything special in module init/exit. This patchset eliminates a lot of ISA driver registration boilerplate code by utilizing module_isa_driver, which replaces module_init and module_exit.
William Breathitt Gray (6):
radio: terratec: Utilize the module_isa_driver macro
radio: rtrack2: Utilize the module_isa_driver macro
radio: trust: Utilize the module_isa_driver macro
radio: zoltrix: Utilize the module_isa_driver macro
radio: aztech: Utilize the module_isa_driver macro
radio: aimslab: Utilize the module_isa_driver macro
drivers/media/radio/radio-aimslab.c | 13 +------------ drivers/media/radio/radio-aztech.c | 13 +------------ drivers/media/radio/radio-rtrack2.c | 13 +------------ drivers/media/radio/radio-terratec.c | 14 +------------- drivers/media/radio/radio-trust.c | 13 +------------ drivers/media/radio/radio-zoltrix.c | 14 +------------- 6 files changed, 6 insertions(+), 74 deletions(-)
Signature · 1 line
2.7.3
PATCH 1/6 radio: terratec: 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/media/radio/radio-terratec.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/media/radio/radio-terratec.c +1 -13
@@ -155,16 +155,4 @@ static struct radio_isa_driver terratec_driver = { .max_volume = 10, }; -static int __init terratec_init (void ) -{ -return isa_register_driver (&terratec_driver.driver,1 ); -} - -static void __exit terratec_exit(void) -{ -isa_unregister_driver (&terratec_driver.driver); -} - -module_init (terratec_init); -module_exit (terratec_exit); - +module_isa_driver (terratec_driver.driver,1 );
Signature · 1 line
2.7.3
PATCH 2/6 radio: rtrack2: Utilize the module_isa_driver macro
In reply to William Breathitt GrayThis 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/media/radio/radio-rtrack2.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/media/radio/radio-rtrack2.c +1 -12
@@ -127,15 +127,4 @@ static struct radio_isa_driver rtrack2_driver = { .has_stereo = true, }; -static int __init rtrack2_init (void ) -{ -return isa_register_driver (&rtrack2_driver.driver,RTRACK2_MAX ); -} - -static void __exit rtrack2_exit(void) -{ -isa_unregister_driver (&rtrack2_driver.driver); -} - -module_init (rtrack2_init); -module_exit (rtrack2_exit); +module_isa_driver (rtrack2_driver.driver,RTRACK2_MAX );
Signature · 1 line
2.7.3
PATCH 3/6 radio: trust: Utilize the module_isa_driver macro
In reply to William Breathitt GrayThis 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/media/radio/radio-trust.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/media/radio/radio-trust.c +1 -12
@@ -229,15 +229,4 @@ static struct radio_isa_driver trust_driver = { .max_volume = 31, }; -static int __init trust_init (void ) -{ -return isa_register_driver (&trust_driver.driver,TRUST_MAX ); -} - -static void __exit trust_exit(void) -{ -isa_unregister_driver (&trust_driver.driver); -} - -module_init (trust_init); -module_exit (trust_exit); +module_isa_driver (trust_driver.driver,TRUST_MAX );
Signature · 1 line
2.7.3
PATCH 4/6 radio: zoltrix: Utilize the module_isa_driver macro
In reply to William Breathitt GrayThis 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/media/radio/radio-zoltrix.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/media/radio/radio-zoltrix.c +1 -13
@@ -233,16 +233,4 @@ static struct radio_isa_driver zoltrix_driver = { .max_volume = 15, }; -static int __init zoltrix_init (void ) -{ -return isa_register_driver (&zoltrix_driver.driver,ZOLTRIX_MAX ); -} - -static void __exit zoltrix_exit(void) -{ -isa_unregister_driver (&zoltrix_driver.driver); -} - -module_init (zoltrix_init); -module_exit (zoltrix_exit); - +module_isa_driver (zoltrix_driver.driver,ZOLTRIX_MAX );
Signature · 1 line
2.7.3
PATCH 5/6 radio: aztech: Utilize the module_isa_driver macro
In reply to William Breathitt GrayThis 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/media/radio/radio-aztech.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/media/radio/radio-aztech.c +1 -12
@@ -147,15 +147,4 @@ static struct radio_isa_driver aztech_driver = { .max_volume = 3, }; -static int __init aztech_init (void ) -{ -return isa_register_driver (&aztech_driver.driver,AZTECH_MAX ); -} - -static void __exit aztech_exit(void) -{ -isa_unregister_driver (&aztech_driver.driver); -} - -module_init (aztech_init); -module_exit (aztech_exit); +module_isa_driver (aztech_driver.driver,AZTECH_MAX );
Signature · 1 line
2.7.3
PATCH 6/6 radio: aimslab: Utilize the module_isa_driver macro
In reply to William Breathitt GrayThis 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/media/radio/radio-aimslab.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/media/radio/radio-aimslab.c +1 -12
@@ -180,15 +180,4 @@ static struct radio_isa_driver rtrack_driver = { .max_volume = 0xff, }; -static int __init rtrack_init (void ) -{ -return isa_register_driver (&rtrack_driver.driver,RTRACK_MAX ); -} - -static void __exit rtrack_exit(void) -{ -isa_unregister_driver (&rtrack_driver.driver); -} - -module_init (rtrack_init); -module_exit (rtrack_exit); +module_isa_driver (rtrack_driver.driver,RTRACK_MAX );
Signature · 1 line
2.7.3
Quoted 5 lines · William Breathitt Gray
The
module_isa_drivermacro is a helper macro for ISA drivers which do not do anything special in module init/exit. This patchset eliminates a lot of ISA driver registration boilerplate code by utilizingmodule_isa_driver, which replacesmodule_initandmodule_exit.
Quoted 7 lines
William Breathitt Gray (6):
radio: terratec: Utilize themodule_isa_drivermacro
radio: rtrack2: Utilize themodule_isa_drivermacro
radio: trust: Utilize themodule_isa_drivermacro
radio: zoltrix: Utilize themodule_isa_drivermacro
radio: aztech: Utilize themodule_isa_drivermacro
radio: aimslab: Utilize themodule_isa_drivermacro
Good idea, but it doesn't compile:
module_isa_driver(terratec_driver.driver, 1);
expands to:
static int __init terratec_driver.driver_init(void)
{
return isa_register_driver(&(terratec_driver.driver), 1);
}So now the function name contains a '.' and it won't compile.
Regards,
Hans
Quoted 25 lines · Hans Verkuil
Quoted 5 lines · William Breathitt Gray
The
module_isa_drivermacro is a helper macro for ISA drivers which do not do anything special in module init/exit. This patchset eliminates a lot of ISA driver registration boilerplate code by utilizingmodule_isa_driver, which replacesmodule_initandmodule_exit.Quoted 7 lines
William Breathitt Gray (6):
radio: terratec: Utilize themodule_isa_drivermacro
radio: rtrack2: Utilize themodule_isa_drivermacro
radio: trust: Utilize themodule_isa_drivermacro
radio: zoltrix: Utilize themodule_isa_drivermacro
radio: aztech: Utilize themodule_isa_drivermacro
radio: aimslab: Utilize themodule_isa_drivermacroGood idea, but it doesn't compile:
module_isa_driver(terratec_driver.driver, 1);expands to:
static int
__initterratec_driver.driver_init(void){ return isa_register_driver(&(terratec_driver.driver), 1); }
Quoted 5 lines
So now the function name contains a '.' and it won't compile.
Regards,
Hans
Oops, looks like I was a bit on autopilot there. I'll have to rethink this patchset at a later point to overcome the symbol naming issue.
Thank you,
William Breathitt Gray