Skip to contentSkip to conversation

ALSA: Utilize the module_isa_driver macro

PATCH Applied William Breathitt Gray 2 participants 13 messages May 31, 2016 – Jun 1, 2016 Sound

lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 1 line
2.7.3
#1 lore raw

PATCH 1/11 ALSA: sb8: 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.

---
 sound/isa/sb/sb8.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
sound/isa/sb/sb8.c +1 -12
index b8e2391..ad42d23 100644
@@ -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);
Signature · 1 line
2.7.3
#2 lore raw

PATCH 2/11 ALSA: jazz16: Utilize the module_isa_driver macro

In reply to 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.

---
 sound/isa/sb/jazz16.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
sound/isa/sb/jazz16.c +1 -12
index 6b4884d..4d90997 100644
@@ -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);
Signature · 1 line
2.7.3
#3 lore raw

PATCH 3/11 ALSA: ad1848: Utilize the module_isa_driver macro

In reply to 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.

---
 sound/isa/ad1848/ad1848.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
sound/isa/ad1848/ad1848.c +1 -12
index f159da4e..a302d1f 100644
@@ -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);
Signature · 1 line
2.7.3
#4 lore raw

PATCH 4/11 ALSA: cmi8328: Utilize the module_isa_driver macro

In reply to 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.

---
 sound/isa/cmi8328.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
sound/isa/cmi8328.c +1 -12
index 2c89d95..7874750 100644
@@ -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);
Signature · 1 line
2.7.3
#5 lore raw

PATCH 5/11 ALSA: cs4231: Utilize the module_isa_driver macro

In reply to 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.

---
 sound/isa/cs423x/cs4231.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
sound/isa/cs423x/cs4231.c +1 -12
index 282cd75..ef7448e 100644
@@ -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);
Signature · 1 line
2.7.3
#6 lore raw

PATCH 6/11 ALSA: gusmax: Utilize the module_isa_driver macro

In reply to 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.

---
 sound/isa/gus/gusmax.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
sound/isa/gus/gusmax.c +1 -12
index 8216e8d..dd88c9d 100644
@@ -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);
Signature · 1 line
2.7.3
#7 lore raw

PATCH 7/11 ALSA: gusextreme: Utilize the module_isa_driver macro

In reply to 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.

---
 sound/isa/gus/gusextreme.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
sound/isa/gus/gusextreme.c +1 -12
index 693d95f..77ac2fd 100644
@@ -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);
Signature · 1 line
2.7.3
#8 lore raw

PATCH 8/11 ALSA: gusclassic: Utilize the module_isa_driver macro

In reply to 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.

---
 sound/isa/gus/gusclassic.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
sound/isa/gus/gusclassic.c +1 -12
index f001971..c169be4 100644
@@ -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);
Signature · 1 line
2.7.3
#9 lore raw

PATCH 9/11 ALSA: sc6000: Utilize the module_isa_driver macro

In reply to 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.

---
 sound/isa/sc6000.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
sound/isa/sc6000.c +1 -12
index 51cfa76..b61a663 100644
@@ -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);
Signature · 1 line
2.7.3
#10 lore raw

PATCH 10/11 ALSA: galaxy: Utilize the module_isa_driver macro

In reply to 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.

---
 sound/isa/galaxy/galaxy.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
sound/isa/galaxy/galaxy.c +1 -12
index 3227884..379abe2 100644
@@ -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);
Signature · 1 line
2.7.3
#11 lore raw

PATCH 11/11 ALSA: adlib: Utilize the module_isa_driver macro

In reply to 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.

---
 sound/isa/adlib.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
sound/isa/adlib.c +1 -12
index 120c524..8d3060f 100644
@@ -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);
Signature · 1 line
2.7.3
Applied
#12 lore raw
In reply to William Breathitt Gray
Quoted 6 lines · William Breathitt Gray

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.

Quoted 12 lines

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