aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/card.c
diff options
context:
space:
mode:
authorAdam Belay <ambx1@neo.rr.com>2006-01-20 03:29:27 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-22 11:10:45 -0500
commitd1d051b28e9d3c3bed0bd15a2b49df3d04f7768f (patch)
treebd9dadbf4bffda15d8b46f9ffc9ee98e4077891b /drivers/pnp/card.c
parentec80859ed292a55334df68fc2492f1303cf3a0ac (diff)
[ALSA] check return code in pnp_register_card_driver()
Signed-off-by: Adam Belay <ambx1@neo.rr.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'drivers/pnp/card.c')
-rw-r--r--drivers/pnp/card.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c
index 0ecbe4edbec1..aaa568a3806e 100644
--- a/drivers/pnp/card.c
+++ b/drivers/pnp/card.c
@@ -363,7 +363,7 @@ static int card_resume(struct pnp_dev *dev)
363 363
364int pnp_register_card_driver(struct pnp_card_driver * drv) 364int pnp_register_card_driver(struct pnp_card_driver * drv)
365{ 365{
366 int count = 0; 366 int count;
367 struct list_head *pos, *temp; 367 struct list_head *pos, *temp;
368 368
369 drv->link.name = drv->name; 369 drv->link.name = drv->name;
@@ -374,10 +374,15 @@ int pnp_register_card_driver(struct pnp_card_driver * drv)
374 drv->link.suspend = drv->suspend ? card_suspend : NULL; 374 drv->link.suspend = drv->suspend ? card_suspend : NULL;
375 drv->link.resume = drv->resume ? card_resume : NULL; 375 drv->link.resume = drv->resume ? card_resume : NULL;
376 376
377 count = pnp_register_driver(&drv->link);
378 if (count < 0)
379 return count;
380
377 spin_lock(&pnp_lock); 381 spin_lock(&pnp_lock);
378 list_add_tail(&drv->global_list, &pnp_card_drivers); 382 list_add_tail(&drv->global_list, &pnp_card_drivers);
379 spin_unlock(&pnp_lock); 383 spin_unlock(&pnp_lock);
380 pnp_register_driver(&drv->link); 384
385 count = 0;
381 386
382 list_for_each_safe(pos,temp,&pnp_cards){ 387 list_for_each_safe(pos,temp,&pnp_cards){
383 struct pnp_card *card = list_entry(pos, struct pnp_card, global_list); 388 struct pnp_card *card = list_entry(pos, struct pnp_card, global_list);