Re: [PATCH] PnP Fixes for 2.6.5

Adam Belay
2004-04-14T20:55:50Z

diff -Nru a/drivers/pnp/manager.c b/drivers/pnp/manager.c
--- a/drivers/pnp/manager.c Wed Apr 14 04:41:52 2004
+++ b/drivers/pnp/manager.c Wed Apr 14 04:41:52 2004
@@ -452,23 +452,19 @@

if (!dev->dependent) {
if (pnp_assign_resources(dev, 0))
- return 1;
- else
return 0;
+ } else {
+ dep = dev->dependent;
+ do {
+ if (pnp_assign_resources(dev, i))
+ return 0;
+ dep = dep->next;
+ i++;
+ } while (dep);
}

- dep = dev->dependent;
- do {
- if (pnp_assign_resources(dev, i))
- return 1;
-
- /* if this dependent resource failed, try the next one */
- dep = dep->next;
- i++;
- } while (dep);
-
pnp_err("Unable to assign resources to device %s.", dev->dev.bus_id);
- return 0;
+ return -EBUSY;
}

/**
@@ -486,7 +482,7 @@
}

/* ensure resources are allocated */
- if (!pnp_auto_config_dev(dev))
+ if (pnp_auto_config_dev(dev))
return -EBUSY;

if (!pnp_can_write(dev)) {