aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/ad1816a/ad1816a.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2006-03-27 04:17:08 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 11:44:53 -0500
commit5f53f4e2107fcfdd33da1cc34a86c9aef5e76af6 (patch)
tree18e3fb83d69667cf24b677ced4f604c6cd6a2549 /sound/isa/ad1816a/ad1816a.c
parent982c609448b9d724e1c3a0d5aeee388c064479f0 (diff)
[PATCH] PNP: adjust pnp_register_card_driver() signature: ad1816a
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>
Diffstat (limited to 'sound/isa/ad1816a/ad1816a.c')
-rw-r--r--sound/isa/ad1816a/ad1816a.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c
index 7051f7798ed7..31f299aed281 100644
--- a/sound/isa/ad1816a/ad1816a.c
+++ b/sound/isa/ad1816a/ad1816a.c
@@ -262,6 +262,8 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard
262 return 0; 262 return 0;
263} 263}
264 264
265static unsigned int __devinitdata ad1816a_devices;
266
265static int __devinit snd_ad1816a_pnp_detect(struct pnp_card_link *card, 267static int __devinit snd_ad1816a_pnp_detect(struct pnp_card_link *card,
266 const struct pnp_card_device_id *id) 268 const struct pnp_card_device_id *id)
267{ 269{
@@ -275,6 +277,7 @@ static int __devinit snd_ad1816a_pnp_detect(struct pnp_card_link *card,
275 if (res < 0) 277 if (res < 0)
276 return res; 278 return res;
277 dev++; 279 dev++;
280 ad1816a_devices++;
278 return 0; 281 return 0;
279 } 282 }
280 return -ENODEV; 283 return -ENODEV;
@@ -297,10 +300,13 @@ static struct pnp_card_driver ad1816a_pnpc_driver = {
297 300
298static int __init alsa_card_ad1816a_init(void) 301static int __init alsa_card_ad1816a_init(void)
299{ 302{
300 int cards; 303 int err;
304
305 err = pnp_register_card_driver(&ad1816a_pnpc_driver);
306 if (err)
307 return err;
301 308
302 cards = pnp_register_card_driver(&ad1816a_pnpc_driver); 309 if (!ad1816a_devices) {
303 if (cards <= 0) {
304 pnp_unregister_card_driver(&ad1816a_pnpc_driver); 310 pnp_unregister_card_driver(&ad1816a_pnpc_driver);
305#ifdef MODULE 311#ifdef MODULE
306 printk(KERN_ERR "no AD1816A based soundcards found.\n"); 312 printk(KERN_ERR "no AD1816A based soundcards found.\n");