summaryrefslogtreecommitdiffstats
path: root/sound/isa/adlib.c
diff options
context:
space:
mode:
authorRene Herman2006-04-11 14:09:37 +0200
committerJaroslav Kysela2006-04-12 11:55:32 +0200
commitdcccdd938ef0c5d96145957217b814b14bd46cdc (patch)
tree8522ad7957ee85a7f0ab53f776afee8a05795be7 /sound/isa/adlib.c
parent[ALSA] continue on IS_ERR from platform device registration (diff)
downloadkernel-qcow2-linux-dcccdd938ef0c5d96145957217b814b14bd46cdc.tar.gz
kernel-qcow2-linux-dcccdd938ef0c5d96145957217b814b14bd46cdc.tar.xz
kernel-qcow2-linux-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/adlib.c')
-rw-r--r--sound/isa/adlib.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/isa/adlib.c b/sound/isa/adlib.c
index a253a14e6a45..1124344ed948 100644
--- a/sound/isa/adlib.c
+++ b/sound/isa/adlib.c
@@ -43,8 +43,7 @@ static int __devinit snd_adlib_probe(struct platform_device *device)
struct snd_card *card;
struct snd_opl3 *opl3;
- int error;
- int i = device->id;
+ int error, i = device->id;
if (port[i] == SNDRV_AUTO_PORT) {
snd_printk(KERN_ERR DRV_NAME ": please specify port\n");
@@ -95,8 +94,7 @@ static int __devinit snd_adlib_probe(struct platform_device *device)
return 0;
out1: snd_card_free(card);
- out0: error = -EINVAL; /* FIXME: should be the original error code */
- return error;
+out0: return error;
}
static int __devexit snd_adlib_remove(struct platform_device *device)
@@ -134,6 +132,11 @@ static int __init alsa_card_adlib_init(void)
if (IS_ERR(device))
continue;
+ if (!platform_get_drvdata(device)) {
+ platform_device_unregister(device);
+ continue;
+ }
+
devices[i] = device;
cards++;
}