diff options
author | Adam Belay <ambx1@neo.rr.com> | 2006-01-20 09:29:27 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-22 17:10:45 +0100 |
commit | d1d051b28e9d3c3bed0bd15a2b49df3d04f7768f (patch) | |
tree | bd9dadbf4bffda15d8b46f9ffc9ee98e4077891b | |
parent | ec80859ed292a55334df68fc2492f1303cf3a0ac (diff) | |
download | linux-3.10-d1d051b28e9d3c3bed0bd15a2b49df3d04f7768f.tar.gz linux-3.10-d1d051b28e9d3c3bed0bd15a2b49df3d04f7768f.tar.bz2 linux-3.10-d1d051b28e9d3c3bed0bd15a2b49df3d04f7768f.zip |
[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>
-rw-r--r-- | drivers/pnp/card.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c index 0ecbe4edbec..aaa568a3806 100644 --- a/drivers/pnp/card.c +++ b/drivers/pnp/card.c @@ -363,7 +363,7 @@ static int card_resume(struct pnp_dev *dev) int pnp_register_card_driver(struct pnp_card_driver * drv) { - int count = 0; + int count; struct list_head *pos, *temp; drv->link.name = drv->name; @@ -374,10 +374,15 @@ int pnp_register_card_driver(struct pnp_card_driver * drv) drv->link.suspend = drv->suspend ? card_suspend : NULL; drv->link.resume = drv->resume ? card_resume : NULL; + count = pnp_register_driver(&drv->link); + if (count < 0) + return count; + spin_lock(&pnp_lock); list_add_tail(&drv->global_list, &pnp_card_drivers); spin_unlock(&pnp_lock); - pnp_register_driver(&drv->link); + + count = 0; list_for_each_safe(pos,temp,&pnp_cards){ struct pnp_card *card = list_entry(pos, struct pnp_card, global_list); |