diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2006-03-27 01:17:08 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-27 08:44:53 -0800 |
commit | 982c609448b9d724e1c3a0d5aeee388c064479f0 (patch) | |
tree | 8e402d45943ec27c0b93d2f5aeb376f6aa512215 /drivers/pnp/card.c | |
parent | 070c6999831dc4cfd9b07c74c2fea1964d7adfec (diff) |
[PATCH] pnp: PNP: adjust pnp_register_driver signature
Remove the assumption that pnp_register_driver() returns the number of devices
claimed. Returning the count is unreliable because devices may be hot-plugged
in the future.
This changes the convention to "zero for success, or a negative error value,"
which matches pci_register_driver(), acpi_bus_register_driver(), and
platform_driver_register().
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/pnp/card.c')
-rw-r--r-- | drivers/pnp/card.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c index b68eef251614..bb19c64073c6 100644 --- a/drivers/pnp/card.c +++ b/drivers/pnp/card.c @@ -47,7 +47,7 @@ static void card_remove(struct pnp_dev * dev) { dev->card_link = NULL; } - + static void card_remove_first(struct pnp_dev * dev) { struct pnp_card_driver * drv = to_pnp_card_driver(dev->driver); @@ -361,7 +361,7 @@ static int card_resume(struct pnp_dev *dev) int pnp_register_card_driver(struct pnp_card_driver * drv) { - int count; + int error; struct list_head *pos, *temp; drv->link.name = drv->name; @@ -372,21 +372,19 @@ 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; + error = pnp_register_driver(&drv->link); + if (error < 0) + return error; spin_lock(&pnp_lock); list_add_tail(&drv->global_list, &pnp_card_drivers); spin_unlock(&pnp_lock); - count = 0; - list_for_each_safe(pos,temp,&pnp_cards){ struct pnp_card *card = list_entry(pos, struct pnp_card, global_list); - count += card_probe(card,drv); + card_probe(card,drv); } - return count; + return 0; } /** |