diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2006-03-27 04:17:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-27 11:44:53 -0500 |
commit | db2735eb9076c5176ec9dcbbaefd38e7d82f0e47 (patch) | |
tree | 0844f8816317a7aa27804b31456817fc908eff28 | |
parent | 51427ec0f222cb73b21f3849416a95d751bdd742 (diff) |
[PATCH] PNP: adjust pnp_register_card_driver() signature: azt2320
Remove the assumption that pnp_register_card_driver() returns the
number of devices claimed.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Jaroslav Kysela <perex@suse.cz>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-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"); |