aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/opti9xx
diff options
context:
space:
mode:
authorRene Herman <rene.herman@keyaccess.nl>2006-04-11 14:09:37 +0200
committerJaroslav Kysela <perex@suse.cz>2006-04-12 11:55:32 +0200
commitdcccdd938ef0c5d96145957217b814b14bd46cdc (patch)
tree8522ad7957ee85a7f0ab53f776afee8a05795be7 /sound/isa/opti9xx
parent[ALSA] continue on IS_ERR from platform device registration (diff)
downloadlinux-dev-dcccdd938ef0c5d96145957217b814b14bd46cdc.tar.xz
linux-dev-dcccdd938ef0c5d96145957217b814b14bd46cdc.zip
[ALSA] unregister platform device again if probe was unsuccessful
Unregister the platform device again if the probe was unsuccessful. This restores the behaviour of not loading the driver on probe() failure. Signed-off-by: Rene Herman <rene.herman@keyaccess.nl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/opti9xx')
-rw-r--r--sound/isa/opti9xx/miro.c7
-rw-r--r--sound/isa/opti9xx/opti92x-ad1848.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c
index 09384d03dc31..83d64bc07ff0 100644
--- a/sound/isa/opti9xx/miro.c
+++ b/sound/isa/opti9xx/miro.c
@@ -1436,8 +1436,11 @@ static int __init alsa_card_miro_init(void)
if ((error = platform_driver_register(&snd_miro_driver)) < 0)
return error;
device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0);
- if (! IS_ERR(device))
- return 0;
+ if (! IS_ERR(device)) {
+ if (platform_get_drvdata(device))
+ return 0;
+ platform_device_unregister(device);
+ }
#ifdef MODULE
printk(KERN_ERR "no miro soundcard found\n");
#endif
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index 65b28cbc0ebd..8ee0d70536f9 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -2099,8 +2099,11 @@ static int __init alsa_card_opti9xx_init(void)
return error;
device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0);
if (!IS_ERR(device)) {
- snd_opti9xx_platform_device = device;
- return 0;
+ if (platform_get_drvdata(device)) {
+ snd_opti9xx_platform_device = device;
+ return 0;
+ }
+ platform_device_unregister(device);
}
platform_driver_unregister(&snd_opti9xx_driver);
}