[alsa-devel] [PATCH 00/11] ALSA: 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 (11): ALSA: sb8: Utilize the module_isa_driver macro ALSA: jazz16: Utilize the module_isa_driver macro ALSA: ad1848: Utilize the module_isa_driver macro ALSA: cmi8328: Utilize the module_isa_driver macro ALSA: cs4231: Utilize the module_isa_driver macro ALSA: gusmax: Utilize the module_isa_driver macro ALSA: gusextreme: Utilize the module_isa_driver macro ALSA: gusclassic: Utilize the module_isa_driver macro ALSA: sc6000: Utilize the module_isa_driver macro ALSA: galaxy: Utilize the module_isa_driver macro ALSA: adlib: Utilize the module_isa_driver macro
sound/isa/ad1848/ad1848.c | 13 +------------ sound/isa/adlib.c | 13 +------------ sound/isa/cmi8328.c | 13 +------------ sound/isa/cs423x/cs4231.c | 13 +------------ sound/isa/galaxy/galaxy.c | 13 +------------ sound/isa/gus/gusclassic.c | 13 +------------ sound/isa/gus/gusextreme.c | 13 +------------ sound/isa/gus/gusmax.c | 13 +------------ sound/isa/sb/jazz16.c | 13 +------------ sound/isa/sb/sb8.c | 13 +------------ sound/isa/sc6000.c | 13 +------------ 11 files changed, 11 insertions(+), 132 deletions(-)
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.
Signed-off-by: William Breathitt Gray vilhelm.gray@gmail.com --- sound/isa/sb/sb8.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c index b8e2391..ad42d23 100644 --- a/sound/isa/sb/sb8.c +++ b/sound/isa/sb/sb8.c @@ -251,15 +251,4 @@ static struct isa_driver snd_sb8_driver = { }, };
-static int __init alsa_card_sb8_init(void) -{ - return isa_register_driver(&snd_sb8_driver, SNDRV_CARDS); -} - -static void __exit alsa_card_sb8_exit(void) -{ - isa_unregister_driver(&snd_sb8_driver); -} - -module_init(alsa_card_sb8_init) -module_exit(alsa_card_sb8_exit) +module_isa_driver(snd_sb8_driver, SNDRV_CARDS);
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.
Signed-off-by: William Breathitt Gray vilhelm.gray@gmail.com --- sound/isa/sb/jazz16.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/sound/isa/sb/jazz16.c b/sound/isa/sb/jazz16.c index 6b4884d..4d90997 100644 --- a/sound/isa/sb/jazz16.c +++ b/sound/isa/sb/jazz16.c @@ -387,15 +387,4 @@ static struct isa_driver snd_jazz16_driver = { }, };
-static int __init alsa_card_jazz16_init(void) -{ - return isa_register_driver(&snd_jazz16_driver, SNDRV_CARDS); -} - -static void __exit alsa_card_jazz16_exit(void) -{ - isa_unregister_driver(&snd_jazz16_driver); -} - -module_init(alsa_card_jazz16_init) -module_exit(alsa_card_jazz16_exit) +module_isa_driver(snd_jazz16_driver, SNDRV_CARDS);
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.
Signed-off-by: William Breathitt Gray vilhelm.gray@gmail.com --- sound/isa/ad1848/ad1848.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c index f159da4e..a302d1f 100644 --- a/sound/isa/ad1848/ad1848.c +++ b/sound/isa/ad1848/ad1848.c @@ -170,15 +170,4 @@ static struct isa_driver snd_ad1848_driver = { } };
-static int __init alsa_card_ad1848_init(void) -{ - return isa_register_driver(&snd_ad1848_driver, SNDRV_CARDS); -} - -static void __exit alsa_card_ad1848_exit(void) -{ - isa_unregister_driver(&snd_ad1848_driver); -} - -module_init(alsa_card_ad1848_init); -module_exit(alsa_card_ad1848_exit); +module_isa_driver(snd_ad1848_driver, SNDRV_CARDS);
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.
Signed-off-by: William Breathitt Gray vilhelm.gray@gmail.com --- sound/isa/cmi8328.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/sound/isa/cmi8328.c b/sound/isa/cmi8328.c index 2c89d95..7874750 100644 --- a/sound/isa/cmi8328.c +++ b/sound/isa/cmi8328.c @@ -469,15 +469,4 @@ static struct isa_driver snd_cmi8328_driver = { }, };
-static int __init alsa_card_cmi8328_init(void) -{ - return isa_register_driver(&snd_cmi8328_driver, CMI8328_MAX); -} - -static void __exit alsa_card_cmi8328_exit(void) -{ - isa_unregister_driver(&snd_cmi8328_driver); -} - -module_init(alsa_card_cmi8328_init) -module_exit(alsa_card_cmi8328_exit) +module_isa_driver(snd_cmi8328_driver, CMI8328_MAX);
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.
Signed-off-by: William Breathitt Gray vilhelm.gray@gmail.com --- sound/isa/cs423x/cs4231.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c index 282cd75..ef7448e 100644 --- a/sound/isa/cs423x/cs4231.c +++ b/sound/isa/cs423x/cs4231.c @@ -186,15 +186,4 @@ static struct isa_driver snd_cs4231_driver = { } };
-static int __init alsa_card_cs4231_init(void) -{ - return isa_register_driver(&snd_cs4231_driver, SNDRV_CARDS); -} - -static void __exit alsa_card_cs4231_exit(void) -{ - isa_unregister_driver(&snd_cs4231_driver); -} - -module_init(alsa_card_cs4231_init); -module_exit(alsa_card_cs4231_exit); +module_isa_driver(snd_cs4231_driver, SNDRV_CARDS);
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.
Signed-off-by: William Breathitt Gray vilhelm.gray@gmail.com --- sound/isa/gus/gusmax.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c index 8216e8d..dd88c9d 100644 --- a/sound/isa/gus/gusmax.c +++ b/sound/isa/gus/gusmax.c @@ -370,15 +370,4 @@ static struct isa_driver snd_gusmax_driver = { }, };
-static int __init alsa_card_gusmax_init(void) -{ - return isa_register_driver(&snd_gusmax_driver, SNDRV_CARDS); -} - -static void __exit alsa_card_gusmax_exit(void) -{ - isa_unregister_driver(&snd_gusmax_driver); -} - -module_init(alsa_card_gusmax_init) -module_exit(alsa_card_gusmax_exit) +module_isa_driver(snd_gusmax_driver, SNDRV_CARDS);
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.
Signed-off-by: William Breathitt Gray vilhelm.gray@gmail.com --- sound/isa/gus/gusextreme.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c index 693d95f..77ac2fd 100644 --- a/sound/isa/gus/gusextreme.c +++ b/sound/isa/gus/gusextreme.c @@ -358,15 +358,4 @@ static struct isa_driver snd_gusextreme_driver = { } };
-static int __init alsa_card_gusextreme_init(void) -{ - return isa_register_driver(&snd_gusextreme_driver, SNDRV_CARDS); -} - -static void __exit alsa_card_gusextreme_exit(void) -{ - isa_unregister_driver(&snd_gusextreme_driver); -} - -module_init(alsa_card_gusextreme_init); -module_exit(alsa_card_gusextreme_exit); +module_isa_driver(snd_gusextreme_driver, SNDRV_CARDS);
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.
Signed-off-by: William Breathitt Gray vilhelm.gray@gmail.com --- sound/isa/gus/gusclassic.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c index f001971..c169be4 100644 --- a/sound/isa/gus/gusclassic.c +++ b/sound/isa/gus/gusclassic.c @@ -229,15 +229,4 @@ static struct isa_driver snd_gusclassic_driver = { } };
-static int __init alsa_card_gusclassic_init(void) -{ - return isa_register_driver(&snd_gusclassic_driver, SNDRV_CARDS); -} - -static void __exit alsa_card_gusclassic_exit(void) -{ - isa_unregister_driver(&snd_gusclassic_driver); -} - -module_init(alsa_card_gusclassic_init); -module_exit(alsa_card_gusclassic_exit); +module_isa_driver(snd_gusclassic_driver, SNDRV_CARDS);
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.
Signed-off-by: William Breathitt Gray vilhelm.gray@gmail.com --- sound/isa/sc6000.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/sound/isa/sc6000.c b/sound/isa/sc6000.c index 51cfa76..b61a663 100644 --- a/sound/isa/sc6000.c +++ b/sound/isa/sc6000.c @@ -711,15 +711,4 @@ static struct isa_driver snd_sc6000_driver = { };
-static int __init alsa_card_sc6000_init(void) -{ - return isa_register_driver(&snd_sc6000_driver, SNDRV_CARDS); -} - -static void __exit alsa_card_sc6000_exit(void) -{ - isa_unregister_driver(&snd_sc6000_driver); -} - -module_init(alsa_card_sc6000_init) -module_exit(alsa_card_sc6000_exit) +module_isa_driver(snd_sc6000_driver, SNDRV_CARDS);
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.
Signed-off-by: William Breathitt Gray vilhelm.gray@gmail.com --- sound/isa/galaxy/galaxy.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/sound/isa/galaxy/galaxy.c b/sound/isa/galaxy/galaxy.c index 3227884..379abe2 100644 --- a/sound/isa/galaxy/galaxy.c +++ b/sound/isa/galaxy/galaxy.c @@ -634,15 +634,4 @@ static struct isa_driver snd_galaxy_driver = { } };
-static int __init alsa_card_galaxy_init(void) -{ - return isa_register_driver(&snd_galaxy_driver, SNDRV_CARDS); -} - -static void __exit alsa_card_galaxy_exit(void) -{ - isa_unregister_driver(&snd_galaxy_driver); -} - -module_init(alsa_card_galaxy_init); -module_exit(alsa_card_galaxy_exit); +module_isa_driver(snd_galaxy_driver, SNDRV_CARDS);
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.
Signed-off-by: William Breathitt Gray vilhelm.gray@gmail.com --- sound/isa/adlib.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/sound/isa/adlib.c b/sound/isa/adlib.c index 120c524..8d3060f 100644 --- a/sound/isa/adlib.c +++ b/sound/isa/adlib.c @@ -112,15 +112,4 @@ static struct isa_driver snd_adlib_driver = { } };
-static int __init alsa_card_adlib_init(void) -{ - return isa_register_driver(&snd_adlib_driver, SNDRV_CARDS); -} - -static void __exit alsa_card_adlib_exit(void) -{ - isa_unregister_driver(&snd_adlib_driver); -} - -module_init(alsa_card_adlib_init); -module_exit(alsa_card_adlib_exit); +module_isa_driver(snd_adlib_driver, SNDRV_CARDS);
On Tue, 31 May 2016 17:54:16 +0200, William Breathitt Gray wrote:
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 (11): ALSA: sb8: Utilize the module_isa_driver macro ALSA: jazz16: Utilize the module_isa_driver macro ALSA: ad1848: Utilize the module_isa_driver macro ALSA: cmi8328: Utilize the module_isa_driver macro ALSA: cs4231: Utilize the module_isa_driver macro ALSA: gusmax: Utilize the module_isa_driver macro ALSA: gusextreme: Utilize the module_isa_driver macro ALSA: gusclassic: Utilize the module_isa_driver macro ALSA: sc6000: Utilize the module_isa_driver macro ALSA: galaxy: Utilize the module_isa_driver macro ALSA: adlib: Utilize the module_isa_driver macro
Thanks, applied all patches now.
Takashi
participants (2)
-
Takashi Iwai
-
William Breathitt Gray