aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2006-03-27 04:17:09 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 11:44:53 -0500
commit51427ec0f222cb73b21f3849416a95d751bdd742 (patch)
tree7915818c4cb5e268e8c317eed9c89f28d290f175 /sound
parent5f53f4e2107fcfdd33da1cc34a86c9aef5e76af6 (diff)
[PATCH] PNP: adjust pnp_register_card_driver() signature: als100
Remove the assumption that pnp_register_card_driver() returns the number of devices claimed. And fix a __init/__devinit issue. 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')
-rw-r--r--sound/isa/als100.c14
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
202static int __init snd_card_als100_probe(int dev, 202static 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
284static unsigned int __devinitdata als100_devices;
285
284static int __devinit snd_als100_pnp_detect(struct pnp_card_link *card, 286static 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
346static int __init alsa_card_als100_init(void) 349static 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");