diff options
Diffstat (limited to 'sound/isa/azt2320.c')
-rw-r--r-- | sound/isa/azt2320.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/isa/azt2320.c b/sound/isa/azt2320.c index a530691bf4f7..15e59283aac6 100644 --- a/sound/isa/azt2320.c +++ b/sound/isa/azt2320.c | |||
@@ -310,6 +310,8 @@ static int __devinit snd_card_azt2320_probe(int dev, | |||
310 | return 0; | 310 | return 0; |
311 | } | 311 | } |
312 | 312 | ||
313 | static unsigned int __devinitdata azt2320_devices; | ||
314 | |||
313 | static int __devinit snd_azt2320_pnp_detect(struct pnp_card_link *card, | 315 | static int __devinit snd_azt2320_pnp_detect(struct pnp_card_link *card, |
314 | const struct pnp_card_device_id *id) | 316 | const struct pnp_card_device_id *id) |
315 | { | 317 | { |
@@ -323,6 +325,7 @@ static int __devinit snd_azt2320_pnp_detect(struct pnp_card_link *card, | |||
323 | if (res < 0) | 325 | if (res < 0) |
324 | return res; | 326 | return res; |
325 | dev++; | 327 | dev++; |
328 | azt2320_devices++; | ||
326 | return 0; | 329 | return 0; |
327 | } | 330 | } |
328 | return -ENODEV; | 331 | return -ENODEV; |
@@ -372,10 +375,13 @@ static struct pnp_card_driver azt2320_pnpc_driver = { | |||
372 | 375 | ||
373 | static int __init alsa_card_azt2320_init(void) | 376 | static int __init alsa_card_azt2320_init(void) |
374 | { | 377 | { |
375 | int cards; | 378 | int err; |
379 | |||
380 | err = pnp_register_card_driver(&azt2320_pnpc_driver); | ||
381 | if (err) | ||
382 | return err; | ||
376 | 383 | ||
377 | cards = pnp_register_card_driver(&azt2320_pnpc_driver); | 384 | if (!azt2320_devices) { |
378 | if (cards <= 0) { | ||
379 | pnp_unregister_card_driver(&azt2320_pnpc_driver); | 385 | pnp_unregister_card_driver(&azt2320_pnpc_driver); |
380 | #ifdef MODULE | 386 | #ifdef MODULE |
381 | snd_printk(KERN_ERR "no AZT2320 based soundcards found\n"); | 387 | snd_printk(KERN_ERR "no AZT2320 based soundcards found\n"); |