aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2006-03-27 04:17:12 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 11:44:54 -0500
commit6736a6587b991477aae927c37176e8cab8689f9e (patch)
treec529a1a472e652648bf1ffd20e2e7932de37fefd
parent07d58ad06b46e630a5ff6b10e9b81f370b175b56 (diff)
[PATCH] PNP: adjust pnp_register_card_driver() signature: dt019x
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/dt019x.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/isa/dt019x.c b/sound/isa/dt019x.c
index 50e7bc5ef561..0acb4e5da47f 100644
--- a/sound/isa/dt019x.c
+++ b/sound/isa/dt019x.c
@@ -272,6 +272,8 @@ static int __devinit snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard,
272 return 0; 272 return 0;
273} 273}
274 274
275static unsigned int __devinitdata dt019x_devices;
276
275static int __devinit snd_dt019x_pnp_probe(struct pnp_card_link *card, 277static int __devinit snd_dt019x_pnp_probe(struct pnp_card_link *card,
276 const struct pnp_card_device_id *pid) 278 const struct pnp_card_device_id *pid)
277{ 279{
@@ -285,6 +287,7 @@ static int __devinit snd_dt019x_pnp_probe(struct pnp_card_link *card,
285 if (res < 0) 287 if (res < 0)
286 return res; 288 return res;
287 dev++; 289 dev++;
290 dt019x_devices++;
288 return 0; 291 return 0;
289 } 292 }
290 return -ENODEV; 293 return -ENODEV;
@@ -336,10 +339,13 @@ static struct pnp_card_driver dt019x_pnpc_driver = {
336 339
337static int __init alsa_card_dt019x_init(void) 340static int __init alsa_card_dt019x_init(void)
338{ 341{
339 int cards = 0; 342 int err;
343
344 err = pnp_register_card_driver(&dt019x_pnpc_driver);
345 if (err)
346 return err;
340 347
341 cards = pnp_register_card_driver(&dt019x_pnpc_driver); 348 if (!dt019x_devices) {
342 if (cards <= 0) {
343 pnp_unregister_card_driver(&dt019x_pnpc_driver); 349 pnp_unregister_card_driver(&dt019x_pnpc_driver);
344#ifdef MODULE 350#ifdef MODULE
345 snd_printk(KERN_ERR "no DT-019X / ALS-007 based soundcards found\n"); 351 snd_printk(KERN_ERR "no DT-019X / ALS-007 based soundcards found\n");