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
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
sound
/
isa
/
opl3sa2.c
diff --git
a/sound/isa/opl3sa2.c
b/sound/isa/opl3sa2.c
index
6d88905
..
9d84319
100644
(file)
--- a/
sound/isa/opl3sa2.c
+++ b/
sound/isa/opl3sa2.c
@@
-95,7
+95,6
@@
static struct platform_device *platform_devices[SNDRV_CARDS];
static int pnp_registered;
static int pnpc_registered;
#endif
static int pnp_registered;
static int pnpc_registered;
#endif
-static unsigned int snd_opl3sa2_devices;
/* control ports */
#define OPL3SA2_PM_CTRL 0x01
/* control ports */
#define OPL3SA2_PM_CTRL 0x01
@@
-761,7
+760,6
@@
static int __devinit snd_opl3sa2_pnp_detect(struct pnp_dev *pdev,
}
pnp_set_drvdata(pdev, card);
dev++;
}
pnp_set_drvdata(pdev, card);
dev++;
- snd_opl3sa2_devices++;
return 0;
}
return 0;
}
@@
-828,7
+826,6
@@
static int __devinit snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard,
}
pnp_set_card_drvdata(pcard, card);
dev++;
}
pnp_set_card_drvdata(pcard, card);
dev++;
- snd_opl3sa2_devices++;
return 0;
}
return 0;
}
@@
-947,48
+944,52
@@
static void __init_or_module snd_opl3sa2_unregister_all(void)
static int __init alsa_card_opl3sa2_init(void)
{
static int __init alsa_card_opl3sa2_init(void)
{
- int i, err;
+ int i, err
, cards = 0
;
if ((err = platform_driver_register(&snd_opl3sa2_nonpnp_driver)) < 0)
return err;
if ((err = platform_driver_register(&snd_opl3sa2_nonpnp_driver)) < 0)
return err;
- for (i = 0; i < SNDRV_CARDS; i++) {
+ for (i = 0; i < SNDRV_CARDS
&& enable[i]
; i++) {
struct platform_device *device;
struct platform_device *device;
- if (! enable[i])
- continue;
#ifdef CONFIG_PNP
if (isapnp[i])
continue;
#endif
device = platform_device_register_simple(OPL3SA2_DRIVER,
i, NULL, 0);
#ifdef CONFIG_PNP
if (isapnp[i])
continue;
#endif
device = platform_device_register_simple(OPL3SA2_DRIVER,
i, NULL, 0);
- if (IS_ERR(device))
- continue;
- if (!platform_get_drvdata(device)) {
- platform_device_unregister(device);
- continue;
+ if (IS_ERR(device)) {
+ err = PTR_ERR(device);
+ goto errout;
}
platform_devices[i] = device;
}
platform_devices[i] = device;
-
snd_opl3sa2_device
s++;
+
card
s++;
}
#ifdef CONFIG_PNP
err = pnp_register_driver(&opl3sa2_pnp_driver);
}
#ifdef CONFIG_PNP
err = pnp_register_driver(&opl3sa2_pnp_driver);
- if (
!err)
+ if (
err >= 0) {
pnp_registered = 1;
pnp_registered = 1;
+ cards += err;
+ }
err = pnp_register_card_driver(&opl3sa2_pnpc_driver);
err = pnp_register_card_driver(&opl3sa2_pnpc_driver);
- if (
!err)
+ if (
err >= 0) {
pnpc_registered = 1;
pnpc_registered = 1;
+ cards += err;
+ }
#endif
#endif
- if (!
snd_opl3sa2_device
s) {
+ if (!
card
s) {
#ifdef MODULE
snd_printk(KERN_ERR "Yamaha OPL3-SA soundcard not found or device busy\n");
#endif
#ifdef MODULE
snd_printk(KERN_ERR "Yamaha OPL3-SA soundcard not found or device busy\n");
#endif
-
snd_opl3sa2_unregister_all()
;
-
return -ENODEV
;
+
err = -ENODEV
;
+
goto errout
;
}
return 0;
}
return 0;
+
+ errout:
+ snd_opl3sa2_unregister_all();
+ return err;
}
static void __exit alsa_card_opl3sa2_exit(void)
}
static void __exit alsa_card_opl3sa2_exit(void)