提交 59b1b34f 编写于 作者: T Takashi Iwai 提交者: Jaroslav Kysela

[ALSA] Fix compilation without CONFIG_PNP

Fix compilation of some ISA drivers without CONFIG_PNP.
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 d82ed2ff
......@@ -109,7 +109,9 @@ module_param_array(wssdma, int, NULL, 0444);
MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver.");
static struct platform_device *platform_devices[SNDRV_CARDS];
#ifdef CONFIG_PNP
static int pnp_registered;
#endif
#define CMI8330_RMUX3D 16
#define CMI8330_MUTEMUX 17
......@@ -672,8 +674,10 @@ static void __init_or_module snd_cmi8330_unregister_all(void)
{
int i;
#ifdef CONFIG_PNP
if (pnp_registered)
pnp_unregister_card_driver(&cmi8330_pnpc_driver);
#endif
for (i = 0; i < ARRAY_SIZE(platform_devices); ++i)
platform_device_unregister(platform_devices[i]);
platform_driver_unregister(&snd_cmi8330_driver);
......@@ -700,11 +704,13 @@ static int __init alsa_card_cmi8330_init(void)
cards++;
}
#ifdef CONFIG_PNP
err = pnp_register_card_driver(&cmi8330_pnpc_driver);
if (err >= 0) {
pnp_registered = 1;
cards += err;
}
#endif
if (!cards) {
#ifdef MODULE
......
......@@ -125,10 +125,12 @@ module_param_array(dma2, int, NULL, 0444);
MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver.");
static struct platform_device *platform_devices[SNDRV_CARDS];
#ifdef CONFIG_PNP
static int pnpc_registered;
#ifdef CS4232
static int pnp_registered;
#endif
#endif /* CONFIG_PNP */
struct snd_card_cs4236 {
struct snd_cs4231 *chip;
......@@ -747,12 +749,14 @@ static void __init_or_module snd_cs423x_unregister_all(void)
{
int i;
#ifdef CONFIG_PNP
if (pnpc_registered)
pnp_unregister_card_driver(&cs423x_pnpc_driver);
#ifdef CS4232
if (pnp_registered)
pnp_unregister_driver(&cs4232_pnp_driver);
#endif
#endif /* CONFIG_PNP */
for (i = 0; i < ARRAY_SIZE(platform_devices); ++i)
platform_device_unregister(platform_devices[i]);
platform_driver_unregister(&cs423x_nonpnp_driver);
......@@ -778,6 +782,7 @@ static int __init alsa_card_cs423x_init(void)
platform_devices[i] = device;
cards++;
}
#ifdef CONFIG_PNP
#ifdef CS4232
i = pnp_register_driver(&cs4232_pnp_driver);
if (i >= 0) {
......@@ -790,6 +795,8 @@ static int __init alsa_card_cs423x_init(void)
pnpc_registered = 1;
cards += i;
}
#endif /* CONFIG_PNP */
if (!cards) {
#ifdef MODULE
printk(KERN_ERR IDENT " soundcard not found or device busy\n");
......
......@@ -1878,9 +1878,9 @@ module_param_array(dma2, int, NULL, 0444);
MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver.");
static struct platform_device *platform_devices[SNDRV_CARDS];
static int pnp_registered;
#ifdef CONFIG_PNP
static int pnp_registered;
static struct pnp_card_device_id snd_audiodrive_pnpids[] = {
/* 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)
{
int i;
#ifdef CONFIG_PNP
if (pnp_registered)
pnp_unregister_card_driver(&es18xx_pnpc_driver);
#endif
for (i = 0; i < ARRAY_SIZE(platform_devices); ++i)
platform_device_unregister(platform_devices[i]);
platform_driver_unregister(&snd_es18xx_nonpnp_driver);
......@@ -2237,11 +2239,13 @@ static int __init alsa_card_es18xx_init(void)
cards++;
}
#ifdef CONFIG_PNP
i = pnp_register_card_driver(&es18xx_pnpc_driver);
if (i >= 0) {
pnp_registered = 1;
cards += i;
}
#endif
if(!cards) {
#ifdef MODULE
......
......@@ -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.");
static struct platform_device *platform_devices[SNDRV_CARDS];
#ifdef CONFIG_PNP
static int pnp_registered;
static int pnpc_registered;
#endif
/* control ports */
#define OPL3SA2_PM_CTRL 0x01
......@@ -929,10 +931,12 @@ static void __init_or_module snd_opl3sa2_unregister_all(void)
{
int i;
#ifdef CONFIG_PNP
if (pnpc_registered)
pnp_unregister_card_driver(&opl3sa2_pnpc_driver);
if (pnp_registered)
pnp_unregister_driver(&opl3sa2_pnp_driver);
#endif
for (i = 0; i < ARRAY_SIZE(platform_devices); ++i)
platform_device_unregister(platform_devices[i]);
platform_driver_unregister(&snd_opl3sa2_nonpnp_driver);
......@@ -961,6 +965,7 @@ static int __init alsa_card_opl3sa2_init(void)
cards++;
}
#ifdef CONFIG_PNP
err = pnp_register_driver(&opl3sa2_pnp_driver);
if (err >= 0) {
pnp_registered = 1;
......@@ -971,6 +976,7 @@ static int __init alsa_card_opl3sa2_init(void)
pnpc_registered = 1;
cards += err;
}
#endif
if (!cards) {
#ifdef MODULE
......
......@@ -69,9 +69,9 @@ module_param_array(dma, int, NULL, 0444);
MODULE_PARM_DESC(dma, "DMA # for SoundScape driver.");
static struct platform_device *platform_devices[SNDRV_CARDS];
static int pnp_registered;
#ifdef CONFIG_PNP
static int pnp_registered;
static struct pnp_card_device_id sscape_pnpids[] = {
{ .id = "ENS3081", .devs = { { "ENS0000" } } },
{ .id = "" } /* end */
......@@ -1391,8 +1391,10 @@ static void __init_or_module sscape_unregister_all(void)
{
int i;
#ifdef CONFIG_PNP
if (pnp_registered)
pnp_unregister_card_driver(&sscape_pnpc_driver);
#endif
for (i = 0; i < ARRAY_SIZE(platform_devices); ++i)
platform_device_unregister(platform_devices[i]);
platform_driver_unregister(&snd_sscape_driver);
......@@ -1466,8 +1468,10 @@ static int __init sscape_init(void)
ret = sscape_manual_probe();
if (ret < 0)
return ret;
#ifdef CONFIG_PNP
if (pnp_register_card_driver(&sscape_pnpc_driver) >= 0)
pnp_registered = 1;
#endif
return 0;
}
......
......@@ -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)");
static struct platform_device *platform_devices[SNDRV_CARDS];
static int pnp_registered;
#ifdef CONFIG_PNP
static int pnp_registered;
static struct pnp_card_device_id snd_wavefront_pnpids[] = {
/* Tropez */
......@@ -695,8 +694,10 @@ static void __init_or_module snd_wavefront_unregister_all(void)
{
int i;
#ifdef CONFIG_PNP
if (pnp_registered)
pnp_unregister_card_driver(&wavefront_pnpc_driver);
#endif
for (i = 0; i < ARRAY_SIZE(platform_devices); ++i)
platform_device_unregister(platform_devices[i]);
platform_driver_unregister(&snd_wavefront_driver);
......@@ -725,11 +726,13 @@ static int __init alsa_card_wavefront_init(void)
cards++;
}
#ifdef CONFIG_PNP
i = pnp_register_card_driver(&wavefront_pnpc_driver);
if (i >= 0) {
pnp_registered = 1;
cards += i;
}
#endif
if (!cards) {
#ifdef MODULE
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册