Commit 3b4216cf authored by Adam Belay's avatar Adam Belay

[PNP] release card devices on probe failure

When a driver's probe routine fails, it may not release all of the
card devices it requested.  This patch allows the pnp layer to ensure
that all devices claimed by the failing driver are released properly.
parent 8ba3fd9a
...@@ -62,8 +62,14 @@ static int card_probe(struct pnp_card * card, struct pnp_card_driver * drv) ...@@ -62,8 +62,14 @@ static int card_probe(struct pnp_card * card, struct pnp_card_driver * drv)
if (drv->probe) { if (drv->probe) {
if (drv->probe(clink, id)>=0) if (drv->probe(clink, id)>=0)
return 1; return 1;
else else {
struct pnp_dev * dev;
card_for_each_dev(card, dev) {
if (dev->card_link == clink)
pnp_release_card_device(dev);
}
kfree(clink); kfree(clink);
}
} else } else
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment