diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/isa/als100.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sound/isa/als100.c b/sound/isa/als100.c index 9b77c17b3f66..a52bd8a14c9b 100644 --- a/sound/isa/als100.c +++ b/sound/isa/als100.c | |||
@@ -199,7 +199,7 @@ static int __devinit snd_card_als100_pnp(int dev, struct snd_card_als100 *acard, | |||
199 | return 0; | 199 | return 0; |
200 | } | 200 | } |
201 | 201 | ||
202 | static int __init snd_card_als100_probe(int dev, | 202 | static int __devinit snd_card_als100_probe(int dev, |
203 | struct pnp_card_link *pcard, | 203 | struct pnp_card_link *pcard, |
204 | const struct pnp_card_device_id *pid) | 204 | const struct pnp_card_device_id *pid) |
205 | { | 205 | { |
@@ -281,6 +281,8 @@ static int __init snd_card_als100_probe(int dev, | |||
281 | return 0; | 281 | return 0; |
282 | } | 282 | } |
283 | 283 | ||
284 | static unsigned int __devinitdata als100_devices; | ||
285 | |||
284 | static int __devinit snd_als100_pnp_detect(struct pnp_card_link *card, | 286 | static int __devinit snd_als100_pnp_detect(struct pnp_card_link *card, |
285 | const struct pnp_card_device_id *id) | 287 | const struct pnp_card_device_id *id) |
286 | { | 288 | { |
@@ -294,6 +296,7 @@ static int __devinit snd_als100_pnp_detect(struct pnp_card_link *card, | |||
294 | if (res < 0) | 296 | if (res < 0) |
295 | return res; | 297 | return res; |
296 | dev++; | 298 | dev++; |
299 | als100_devices++; | ||
297 | return 0; | 300 | return 0; |
298 | } | 301 | } |
299 | return -ENODEV; | 302 | return -ENODEV; |
@@ -345,10 +348,13 @@ static struct pnp_card_driver als100_pnpc_driver = { | |||
345 | 348 | ||
346 | static int __init alsa_card_als100_init(void) | 349 | static int __init alsa_card_als100_init(void) |
347 | { | 350 | { |
348 | int cards; | 351 | int err; |
352 | |||
353 | err = pnp_register_card_driver(&als100_pnpc_driver); | ||
354 | if (err) | ||
355 | return err; | ||
349 | 356 | ||
350 | cards = pnp_register_card_driver(&als100_pnpc_driver); | 357 | if (!als100_devices) { |
351 | if (cards <= 0) { | ||
352 | pnp_unregister_card_driver(&als100_pnpc_driver); | 358 | pnp_unregister_card_driver(&als100_pnpc_driver); |
353 | #ifdef MODULE | 359 | #ifdef MODULE |
354 | snd_printk(KERN_ERR "no ALS100 based soundcards found\n"); | 360 | snd_printk(KERN_ERR "no ALS100 based soundcards found\n"); |