git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
sound
/
isa
/
cs423x
/
cs4236.c
diff --git
a/sound/isa/cs423x/cs4236.c
b/sound/isa/cs423x/cs4236.c
index
99a4213
..
07ffd5c
100644
(file)
--- a/
sound/isa/cs423x/cs4236.c
+++ b/
sound/isa/cs423x/cs4236.c
@@
-133,6
+133,7
@@
static int pnpc_registered;
static int pnp_registered;
#endif
#endif /* CONFIG_PNP */
static int pnp_registered;
#endif
#endif /* CONFIG_PNP */
+static unsigned int snd_cs423x_devices;
struct snd_card_cs4236 {
struct snd_cs4231 *chip;
struct snd_card_cs4236 {
struct snd_cs4231 *chip;
@@
-534,7
+535,7
@@
static int __devinit snd_cs423x_probe(struct snd_card *card, int dev)
if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
mpu_port[dev], 0,
mpu_irq[dev],
if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
mpu_port[dev], 0,
mpu_irq[dev],
- mpu_irq[dev] >= 0 ?
SA_INTERRUPT
: 0, NULL) < 0)
+ mpu_irq[dev] >= 0 ?
IRQF_DISABLED
: 0, NULL) < 0)
printk(KERN_WARNING IDENT ": MPU401 not detected\n");
}
printk(KERN_WARNING IDENT ": MPU401 not detected\n");
}
@@
-564,7
+565,7
@@
static int __init snd_cs423x_nonpnp_probe(struct platform_device *pdev)
snd_card_free(card);
return err;
}
snd_card_free(card);
return err;
}
-
+
platform_set_drvdata(pdev, card);
return 0;
}
platform_set_drvdata(pdev, card);
return 0;
}
@@
-650,6
+651,7
@@
static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev,
}
pnp_set_drvdata(pdev, card);
dev++;
}
pnp_set_drvdata(pdev, card);
dev++;
+ snd_cs423x_devices++;
return 0;
}
return 0;
}
@@
-713,6
+715,7
@@
static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard,
}
pnp_set_card_drvdata(pcard, card);
dev++;
}
pnp_set_card_drvdata(pcard, card);
dev++;
+ snd_cs423x_devices++;
return 0;
}
return 0;
}
@@
-721,7
+724,7
@@
static void __devexit snd_cs423x_pnpc_remove(struct pnp_card_link * pcard)
snd_card_free(pnp_get_card_drvdata(pcard));
pnp_set_card_drvdata(pcard, NULL);
}
snd_card_free(pnp_get_card_drvdata(pcard));
pnp_set_card_drvdata(pcard, NULL);
}
-
+
#ifdef CONFIG_PM
static int snd_cs423x_pnpc_suspend(struct pnp_card_link *pcard, pm_message_t state)
{
#ifdef CONFIG_PM
static int snd_cs423x_pnpc_suspend(struct pnp_card_link *pcard, pm_message_t state)
{
@@
-766,51
+769,45
@@
static void __init_or_module snd_cs423x_unregister_all(void)
static int __init alsa_card_cs423x_init(void)
{
static int __init alsa_card_cs423x_init(void)
{
- int i, err
, cards = 0
;
+ int i, err;
if ((err = platform_driver_register(&cs423x_nonpnp_driver)) < 0)
return err;
if ((err = platform_driver_register(&cs423x_nonpnp_driver)) < 0)
return err;
- for (i = 0; i < SNDRV_CARDS
&& enable[i]
; i++) {
+ for (i = 0; i < SNDRV_CARDS; i++) {
struct platform_device *device;
struct platform_device *device;
- if (is_isapnp_selected(i))
+ if (
! enable[i] ||
is_isapnp_selected(i))
continue;
device = platform_device_register_simple(CS423X_DRIVER,
i, NULL, 0);
continue;
device = platform_device_register_simple(CS423X_DRIVER,
i, NULL, 0);
- if (IS_ERR(device)) {
- err = PTR_ERR(device);
- goto errout;
+ if (IS_ERR(device))
+ continue;
+ if (!platform_get_drvdata(device)) {
+ platform_device_unregister(device);
+ continue;
}
platform_devices[i] = device;
}
platform_devices[i] = device;
-
card
s++;
+
snd_cs423x_device
s++;
}
#ifdef CONFIG_PNP
#ifdef CS4232
}
#ifdef CONFIG_PNP
#ifdef CS4232
-
i
= pnp_register_driver(&cs4232_pnp_driver);
- if (
i >= 0) {
+
err
= pnp_register_driver(&cs4232_pnp_driver);
+ if (
!err)
pnp_registered = 1;
pnp_registered = 1;
- cards += i;
- }
#endif
#endif
-
i
= pnp_register_card_driver(&cs423x_pnpc_driver);
- if (
i >= 0) {
+
err
= pnp_register_card_driver(&cs423x_pnpc_driver);
+ if (
!err)
pnpc_registered = 1;
pnpc_registered = 1;
- cards += i;
- }
#endif /* CONFIG_PNP */
#endif /* CONFIG_PNP */
- if (!
card
s) {
+ if (!
snd_cs423x_device
s) {
#ifdef MODULE
printk(KERN_ERR IDENT " soundcard not found or device busy\n");
#endif
#ifdef MODULE
printk(KERN_ERR IDENT " soundcard not found or device busy\n");
#endif
-
err = -ENODEV
;
-
goto errout
;
+
snd_cs423x_unregister_all()
;
+
return -ENODEV
;
}
return 0;
}
return 0;
-
- errout:
- snd_cs423x_unregister_all();
- return err;
}
static void __exit alsa_card_cs423x_exit(void)
}
static void __exit alsa_card_cs423x_exit(void)