Commit 59b1b34f authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Fix compilation without CONFIG_PNP

Fix compilation of some ISA drivers without CONFIG_PNP.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d82ed2ff
...@@ -109,7 +109,9 @@ module_param_array(wssdma, int, NULL, 0444); ...@@ -109,7 +109,9 @@ module_param_array(wssdma, int, NULL, 0444);
MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver."); MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver.");
static struct platform_device *platform_devices[SNDRV_CARDS]; static struct platform_device *platform_devices[SNDRV_CARDS];
#ifdef CONFIG_PNP
static int pnp_registered; static int pnp_registered;
#endif
#define CMI8330_RMUX3D 16 #define CMI8330_RMUX3D 16
#define CMI8330_MUTEMUX 17 #define CMI8330_MUTEMUX 17
...@@ -672,8 +674,10 @@ static void __init_or_module snd_cmi8330_unregister_all(void) ...@@ -672,8 +674,10 @@ static void __init_or_module snd_cmi8330_unregister_all(void)
{ {
int i; int i;
#ifdef CONFIG_PNP
if (pnp_registered) if (pnp_registered)
pnp_unregister_card_driver(&cmi8330_pnpc_driver); pnp_unregister_card_driver(&cmi8330_pnpc_driver);
#endif
for (i = 0; i < ARRAY_SIZE(platform_devices); ++i) for (i = 0; i < ARRAY_SIZE(platform_devices); ++i)
platform_device_unregister(platform_devices[i]); platform_device_unregister(platform_devices[i]);
platform_driver_unregister(&snd_cmi8330_driver); platform_driver_unregister(&snd_cmi8330_driver);
...@@ -700,11 +704,13 @@ static int __init alsa_card_cmi8330_init(void) ...@@ -700,11 +704,13 @@ static int __init alsa_card_cmi8330_init(void)
cards++; cards++;
} }
#ifdef CONFIG_PNP
err = pnp_register_card_driver(&cmi8330_pnpc_driver); err = pnp_register_card_driver(&cmi8330_pnpc_driver);
if (err >= 0) { if (err >= 0) {
pnp_registered = 1; pnp_registered = 1;
cards += err; cards += err;
} }
#endif
if (!cards) { if (!cards) {
#ifdef MODULE #ifdef MODULE
......
...@@ -125,10 +125,12 @@ module_param_array(dma2, int, NULL, 0444); ...@@ -125,10 +125,12 @@ module_param_array(dma2, int, NULL, 0444);
MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver."); MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver.");
static struct platform_device *platform_devices[SNDRV_CARDS]; static struct platform_device *platform_devices[SNDRV_CARDS];
#ifdef CONFIG_PNP
static int pnpc_registered; static int pnpc_registered;
#ifdef CS4232 #ifdef CS4232
static int pnp_registered; static int pnp_registered;
#endif #endif
#endif /* CONFIG_PNP */
struct snd_card_cs4236 { struct snd_card_cs4236 {
struct snd_cs4231 *chip; struct snd_cs4231 *chip;
...@@ -747,12 +749,14 @@ static void __init_or_module snd_cs423x_unregister_all(void) ...@@ -747,12 +749,14 @@ static void __init_or_module snd_cs423x_unregister_all(void)
{ {
int i; int i;
#ifdef CONFIG_PNP
if (pnpc_registered) if (pnpc_registered)
pnp_unregister_card_driver(&cs423x_pnpc_driver); pnp_unregister_card_driver(&cs423x_pnpc_driver);
#ifdef CS4232 #ifdef CS4232
if (pnp_registered) if (pnp_registered)
pnp_unregister_driver(&cs4232_pnp_driver); pnp_unregister_driver(&cs4232_pnp_driver);
#endif #endif
#endif /* CONFIG_PNP */
for (i = 0; i < ARRAY_SIZE(platform_devices); ++i) for (i = 0; i < ARRAY_SIZE(platform_devices); ++i)
platform_device_unregister(platform_devices[i]); platform_device_unregister(platform_devices[i]);
platform_driver_unregister(&cs423x_nonpnp_driver); platform_driver_unregister(&cs423x_nonpnp_driver);
...@@ -778,6 +782,7 @@ static int __init alsa_card_cs423x_init(void) ...@@ -778,6 +782,7 @@ static int __init alsa_card_cs423x_init(void)
platform_devices[i] = device; platform_devices[i] = device;
cards++; cards++;
} }
#ifdef CONFIG_PNP
#ifdef CS4232 #ifdef CS4232
i = pnp_register_driver(&cs4232_pnp_driver); i = pnp_register_driver(&cs4232_pnp_driver);
if (i >= 0) { if (i >= 0) {
...@@ -790,6 +795,8 @@ static int __init alsa_card_cs423x_init(void) ...@@ -790,6 +795,8 @@ static int __init alsa_card_cs423x_init(void)
pnpc_registered = 1; pnpc_registered = 1;
cards += i; cards += i;
} }
#endif /* CONFIG_PNP */
if (!cards) { if (!cards) {
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR IDENT " soundcard not found or device busy\n"); printk(KERN_ERR IDENT " soundcard not found or device busy\n");
......
...@@ -1878,9 +1878,9 @@ module_param_array(dma2, int, NULL, 0444); ...@@ -1878,9 +1878,9 @@ module_param_array(dma2, int, NULL, 0444);
MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver."); MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver.");
static struct platform_device *platform_devices[SNDRV_CARDS]; static struct platform_device *platform_devices[SNDRV_CARDS];
static int pnp_registered;
#ifdef CONFIG_PNP #ifdef CONFIG_PNP
static int pnp_registered;
static struct pnp_card_device_id snd_audiodrive_pnpids[] = { static struct pnp_card_device_id snd_audiodrive_pnpids[] = {
/* ESS 1868 (integrated on Compaq dual P-Pro motherboard and Genius 18PnP 3D) */ /* ESS 1868 (integrated on Compaq dual P-Pro motherboard and Genius 18PnP 3D) */
...@@ -2209,8 +2209,10 @@ static void __init_or_module snd_es18xx_unregister_all(void) ...@@ -2209,8 +2209,10 @@ static void __init_or_module snd_es18xx_unregister_all(void)
{ {
int i; int i;
#ifdef CONFIG_PNP
if (pnp_registered) if (pnp_registered)
pnp_unregister_card_driver(&es18xx_pnpc_driver); pnp_unregister_card_driver(&es18xx_pnpc_driver);
#endif
for (i = 0; i < ARRAY_SIZE(platform_devices); ++i) for (i = 0; i < ARRAY_SIZE(platform_devices); ++i)
platform_device_unregister(platform_devices[i]); platform_device_unregister(platform_devices[i]);
platform_driver_unregister(&snd_es18xx_nonpnp_driver); platform_driver_unregister(&snd_es18xx_nonpnp_driver);
...@@ -2237,11 +2239,13 @@ static int __init alsa_card_es18xx_init(void) ...@@ -2237,11 +2239,13 @@ static int __init alsa_card_es18xx_init(void)
cards++; cards++;
} }
#ifdef CONFIG_PNP
i = pnp_register_card_driver(&es18xx_pnpc_driver); i = pnp_register_card_driver(&es18xx_pnpc_driver);
if (i >= 0) { if (i >= 0) {
pnp_registered = 1; pnp_registered = 1;
cards += i; cards += i;
} }
#endif
if(!cards) { if(!cards) {
#ifdef MODULE #ifdef MODULE
......
...@@ -91,8 +91,10 @@ module_param_array(opl3sa3_ymode, int, NULL, 0444); ...@@ -91,8 +91,10 @@ module_param_array(opl3sa3_ymode, int, NULL, 0444);
MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi."); MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi.");
static struct platform_device *platform_devices[SNDRV_CARDS]; static struct platform_device *platform_devices[SNDRV_CARDS];
#ifdef CONFIG_PNP
static int pnp_registered; static int pnp_registered;
static int pnpc_registered; static int pnpc_registered;
#endif
/* control ports */ /* control ports */
#define OPL3SA2_PM_CTRL 0x01 #define OPL3SA2_PM_CTRL 0x01
...@@ -929,10 +931,12 @@ static void __init_or_module snd_opl3sa2_unregister_all(void) ...@@ -929,10 +931,12 @@ static void __init_or_module snd_opl3sa2_unregister_all(void)
{ {
int i; int i;
#ifdef CONFIG_PNP
if (pnpc_registered) if (pnpc_registered)
pnp_unregister_card_driver(&opl3sa2_pnpc_driver); pnp_unregister_card_driver(&opl3sa2_pnpc_driver);
if (pnp_registered) if (pnp_registered)
pnp_unregister_driver(&opl3sa2_pnp_driver); pnp_unregister_driver(&opl3sa2_pnp_driver);
#endif
for (i = 0; i < ARRAY_SIZE(platform_devices); ++i) for (i = 0; i < ARRAY_SIZE(platform_devices); ++i)
platform_device_unregister(platform_devices[i]); platform_device_unregister(platform_devices[i]);
platform_driver_unregister(&snd_opl3sa2_nonpnp_driver); platform_driver_unregister(&snd_opl3sa2_nonpnp_driver);
...@@ -961,6 +965,7 @@ static int __init alsa_card_opl3sa2_init(void) ...@@ -961,6 +965,7 @@ static int __init alsa_card_opl3sa2_init(void)
cards++; cards++;
} }
#ifdef CONFIG_PNP
err = pnp_register_driver(&opl3sa2_pnp_driver); err = pnp_register_driver(&opl3sa2_pnp_driver);
if (err >= 0) { if (err >= 0) {
pnp_registered = 1; pnp_registered = 1;
...@@ -971,6 +976,7 @@ static int __init alsa_card_opl3sa2_init(void) ...@@ -971,6 +976,7 @@ static int __init alsa_card_opl3sa2_init(void)
pnpc_registered = 1; pnpc_registered = 1;
cards += err; cards += err;
} }
#endif
if (!cards) { if (!cards) {
#ifdef MODULE #ifdef MODULE
......
...@@ -69,9 +69,9 @@ module_param_array(dma, int, NULL, 0444); ...@@ -69,9 +69,9 @@ module_param_array(dma, int, NULL, 0444);
MODULE_PARM_DESC(dma, "DMA # for SoundScape driver."); MODULE_PARM_DESC(dma, "DMA # for SoundScape driver.");
static struct platform_device *platform_devices[SNDRV_CARDS]; static struct platform_device *platform_devices[SNDRV_CARDS];
static int pnp_registered;
#ifdef CONFIG_PNP #ifdef CONFIG_PNP
static int pnp_registered;
static struct pnp_card_device_id sscape_pnpids[] = { static struct pnp_card_device_id sscape_pnpids[] = {
{ .id = "ENS3081", .devs = { { "ENS0000" } } }, { .id = "ENS3081", .devs = { { "ENS0000" } } },
{ .id = "" } /* end */ { .id = "" } /* end */
...@@ -1391,8 +1391,10 @@ static void __init_or_module sscape_unregister_all(void) ...@@ -1391,8 +1391,10 @@ static void __init_or_module sscape_unregister_all(void)
{ {
int i; int i;
#ifdef CONFIG_PNP
if (pnp_registered) if (pnp_registered)
pnp_unregister_card_driver(&sscape_pnpc_driver); pnp_unregister_card_driver(&sscape_pnpc_driver);
#endif
for (i = 0; i < ARRAY_SIZE(platform_devices); ++i) for (i = 0; i < ARRAY_SIZE(platform_devices); ++i)
platform_device_unregister(platform_devices[i]); platform_device_unregister(platform_devices[i]);
platform_driver_unregister(&snd_sscape_driver); platform_driver_unregister(&snd_sscape_driver);
...@@ -1466,8 +1468,10 @@ static int __init sscape_init(void) ...@@ -1466,8 +1468,10 @@ static int __init sscape_init(void)
ret = sscape_manual_probe(); ret = sscape_manual_probe();
if (ret < 0) if (ret < 0)
return ret; return ret;
#ifdef CONFIG_PNP
if (pnp_register_card_driver(&sscape_pnpc_driver) >= 0) if (pnp_register_card_driver(&sscape_pnpc_driver) >= 0)
pnp_registered = 1; pnp_registered = 1;
#endif
return 0; return 0;
} }
......
...@@ -84,10 +84,9 @@ module_param_array(use_cs4232_midi, bool, NULL, 0444); ...@@ -84,10 +84,9 @@ module_param_array(use_cs4232_midi, bool, NULL, 0444);
MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)"); MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)");
static struct platform_device *platform_devices[SNDRV_CARDS]; static struct platform_device *platform_devices[SNDRV_CARDS];
static int pnp_registered;
#ifdef CONFIG_PNP #ifdef CONFIG_PNP
static int pnp_registered;
static struct pnp_card_device_id snd_wavefront_pnpids[] = { static struct pnp_card_device_id snd_wavefront_pnpids[] = {
/* Tropez */ /* Tropez */
...@@ -695,8 +694,10 @@ static void __init_or_module snd_wavefront_unregister_all(void) ...@@ -695,8 +694,10 @@ static void __init_or_module snd_wavefront_unregister_all(void)
{ {
int i; int i;
#ifdef CONFIG_PNP
if (pnp_registered) if (pnp_registered)
pnp_unregister_card_driver(&wavefront_pnpc_driver); pnp_unregister_card_driver(&wavefront_pnpc_driver);
#endif
for (i = 0; i < ARRAY_SIZE(platform_devices); ++i) for (i = 0; i < ARRAY_SIZE(platform_devices); ++i)
platform_device_unregister(platform_devices[i]); platform_device_unregister(platform_devices[i]);
platform_driver_unregister(&snd_wavefront_driver); platform_driver_unregister(&snd_wavefront_driver);
...@@ -725,11 +726,13 @@ static int __init alsa_card_wavefront_init(void) ...@@ -725,11 +726,13 @@ static int __init alsa_card_wavefront_init(void)
cards++; cards++;
} }
#ifdef CONFIG_PNP
i = pnp_register_card_driver(&wavefront_pnpc_driver); i = pnp_register_card_driver(&wavefront_pnpc_driver);
if (i >= 0) { if (i >= 0) {
pnp_registered = 1; pnp_registered = 1;
cards += i; cards += i;
} }
#endif
if (!cards) { if (!cards) {
#ifdef MODULE #ifdef MODULE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment