Skip to content

Commit

Permalink
[ALSA] Fix compilation without CONFIG_PNP
Browse files Browse the repository at this point in the history
Fix compilation of some ISA drivers without CONFIG_PNP.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Jan 22, 2006
1 parent d82ed2f commit 59b1b34
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 4 deletions.
6 changes: 6 additions & 0 deletions sound/isa/cmi8330.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions sound/isa/cs423x/cs4236.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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) {
Expand All @@ -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");
Expand Down
6 changes: 5 additions & 1 deletion sound/isa/es18xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions sound/isa/opl3sa2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -971,6 +976,7 @@ static int __init alsa_card_opl3sa2_init(void)
pnpc_registered = 1;
cards += err;
}
#endif

if (!cards) {
#ifdef MODULE
Expand Down
6 changes: 5 additions & 1 deletion sound/isa/sscape.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}

Expand Down
7 changes: 5 additions & 2 deletions sound/isa/wavefront/wavefront.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 59b1b34

Please sign in to comment.