diff options
author | Rene Herman <rene.herman@keyaccess.nl> | 2006-04-11 14:09:37 +0200 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-04-12 11:55:32 +0200 |
commit | dcccdd938ef0c5d96145957217b814b14bd46cdc (patch) | |
tree | 8522ad7957ee85a7f0ab53f776afee8a05795be7 /sound | |
parent | d0ac642d76c79c5cc673c4cdfe43e926379784e1 (diff) | |
download | op-kernel-dev-dcccdd938ef0c5d96145957217b814b14bd46cdc.zip op-kernel-dev-dcccdd938ef0c5d96145957217b814b14bd46cdc.tar.gz |
[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')
-rw-r--r-- | sound/isa/ad1848/ad1848.c | 4 | ||||
-rw-r--r-- | sound/isa/adlib.c | 11 | ||||
-rw-r--r-- | sound/isa/cmi8330.c | 4 | ||||
-rw-r--r-- | sound/isa/cs423x/cs4231.c | 4 | ||||
-rw-r--r-- | sound/isa/cs423x/cs4236.c | 4 | ||||
-rw-r--r-- | sound/isa/es1688/es1688.c | 4 | ||||
-rw-r--r-- | sound/isa/es18xx.c | 4 | ||||
-rw-r--r-- | sound/isa/gus/gusclassic.c | 4 | ||||
-rw-r--r-- | sound/isa/gus/gusextreme.c | 4 | ||||
-rw-r--r-- | sound/isa/gus/gusmax.c | 4 | ||||
-rw-r--r-- | sound/isa/gus/interwave.c | 4 | ||||
-rw-r--r-- | sound/isa/opl3sa2.c | 4 | ||||
-rw-r--r-- | sound/isa/opti9xx/miro.c | 7 | ||||
-rw-r--r-- | sound/isa/opti9xx/opti92x-ad1848.c | 7 | ||||
-rw-r--r-- | sound/isa/sb/sb16.c | 4 | ||||
-rw-r--r-- | sound/isa/sb/sb8.c | 4 | ||||
-rw-r--r-- | sound/isa/sgalaxy.c | 4 | ||||
-rw-r--r-- | sound/isa/sscape.c | 4 | ||||
-rw-r--r-- | sound/isa/wavefront/wavefront.c | 4 |
19 files changed, 81 insertions, 8 deletions
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c index 1f460eb..99908e4 100644 --- a/sound/isa/ad1848/ad1848.c +++ b/sound/isa/ad1848/ad1848.c @@ -195,6 +195,10 @@ static int __init alsa_card_ad1848_init(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } devices[i] = device; cards++; } diff --git a/sound/isa/adlib.c b/sound/isa/adlib.c index a253a14..1124344 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++; } diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index 35780b8..3c1e9fd 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c @@ -701,6 +701,10 @@ static int __init alsa_card_cmi8330_init(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } platform_devices[i] = device; cards++; } diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c index 073dac9..397310f 100644 --- a/sound/isa/cs423x/cs4231.c +++ b/sound/isa/cs423x/cs4231.c @@ -211,6 +211,10 @@ static int __init alsa_card_cs4231_init(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } devices[i] = device; cards++; } diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c index b07a62b..f7fa7793 100644 --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c @@ -782,6 +782,10 @@ static int __init alsa_card_cs423x_init(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } platform_devices[i] = device; snd_cs423x_devices++; } diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c index d83d710..e90689e 100644 --- a/sound/isa/es1688/es1688.c +++ b/sound/isa/es1688/es1688.c @@ -215,6 +215,10 @@ static int __init alsa_card_es1688_init(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } devices[i] = device; cards++; } diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index 0da249b..a36ec1d 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c @@ -2393,6 +2393,10 @@ static int __init alsa_card_es18xx_init(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } platform_devices[i] = device; cards++; } diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c index ed34427..37057a3 100644 --- a/sound/isa/gus/gusclassic.c +++ b/sound/isa/gus/gusclassic.c @@ -255,6 +255,10 @@ static int __init alsa_card_gusclassic_init(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } devices[i] = device; cards++; } diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c index aa312de..05852fc 100644 --- a/sound/isa/gus/gusextreme.c +++ b/sound/isa/gus/gusextreme.c @@ -365,6 +365,10 @@ static int __init alsa_card_gusextreme_init(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } devices[i] = device; cards++; } diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c index a733fab..fcf2c8f 100644 --- a/sound/isa/gus/gusmax.c +++ b/sound/isa/gus/gusmax.c @@ -392,6 +392,10 @@ static int __init alsa_card_gusmax_init(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } devices[i] = device; cards++; } diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c index 4be472e..4298d33 100644 --- a/sound/isa/gus/interwave.c +++ b/sound/isa/gus/interwave.c @@ -949,6 +949,10 @@ static int __init alsa_card_interwave_init(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } platform_devices[i] = device; cards++; } diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index 02ae73e..6d88905 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c @@ -964,6 +964,10 @@ static int __init alsa_card_opl3sa2_init(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } platform_devices[i] = device; snd_opl3sa2_devices++; } diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c index 09384d0..83d64bc 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 65b28cb..8ee0d70 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); } diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c index 24fa190..6333f90 100644 --- a/sound/isa/sb/sb16.c +++ b/sound/isa/sb/sb16.c @@ -722,6 +722,10 @@ static int __init alsa_card_sb16_init(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } platform_devices[i] = device; cards++; } diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c index f75eeb0..141400c 100644 --- a/sound/isa/sb/sb8.c +++ b/sound/isa/sb/sb8.c @@ -266,6 +266,10 @@ static int __init alsa_card_sb8_init(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } devices[i] = device; cards++; } diff --git a/sound/isa/sgalaxy.c b/sound/isa/sgalaxy.c index f01a80a..09c8e8c 100644 --- a/sound/isa/sgalaxy.c +++ b/sound/isa/sgalaxy.c @@ -368,6 +368,10 @@ static int __init alsa_card_sgalaxy_init(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } devices[i] = device; cards++; } diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c index 532f6e0..d2a856f 100644 --- a/sound/isa/sscape.c +++ b/sound/isa/sscape.c @@ -1438,6 +1438,10 @@ static int __init sscape_manual_probe(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } platform_devices[i] = device; } return 0; diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c index ed9d017..7ae86f8 100644 --- a/sound/isa/wavefront/wavefront.c +++ b/sound/isa/wavefront/wavefront.c @@ -724,6 +724,10 @@ static int __init alsa_card_wavefront_init(void) i, NULL, 0); if (IS_ERR(device)) continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; + } platform_devices[i] = device; cards++; } |