X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=sound%2Fisa%2Fadlib.c;h=1124344ed948b38005041306e322d8107a7af4d1;hb=0a7d5f8ce960e74fa22986bda4af488539796e49;hp=a253a14e6a45be6ea18e8b982268c855337eefba;hpb=a2308b7f0838406c346a2b0259ff88c7fcf41e79;p=linux-2.6-omap-h63xx.git diff --git a/sound/isa/adlib.c b/sound/isa/adlib.c index a253a14e6a4..1124344ed94 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++; }