]> git.hungrycats.org Git - linux/commitdiff
Silently Ignore if the device is already active/disabled
authorAdam Belay <ambx1@neo.rr.com>
Tue, 25 Mar 2003 21:34:45 +0000 (21:34 +0000)
committerAdam Belay <ambx1@neo.rr.com>
Tue, 25 Mar 2003 21:34:45 +0000 (21:34 +0000)
Some drivers will try to activate a device even though it is already
active.  Instead of returning an error, the resource manager will now
just ignore this.  This should solve some of the recently seen problems.
Also it doesn't make sense to return an error if the device is already
in the correct state.

drivers/pnp/manager.c

index eb4b68a50da53d26485e94bbb965945aa93ae21f..0b168a7b0c48a4631ead04c4c73e9cd73311a6f8 100644 (file)
@@ -632,8 +632,7 @@ int pnp_activate_dev(struct pnp_dev *dev)
        if (!dev)
                return -EINVAL;
        if (dev->active) {
-               pnp_info("res: The PnP device '%s' is already active.", dev->dev.bus_id);
-               return -EBUSY;
+               return 0; /* the device is already active */
        }
        /* If this condition is true, advanced configuration failed, we need to get this device up and running
         * so we use the simple config engine which ignores cold conflicts, this of course may lead to new failures */
@@ -698,8 +697,7 @@ int pnp_disable_dev(struct pnp_dev *dev)
         if (!dev)
                 return -EINVAL;
        if (!dev->active) {
-               pnp_info("res: The PnP device '%s' is already disabled.", dev->dev.bus_id);
-               return -EINVAL;
+               return 0; /* the device is already disabled */
        }
        if (dev->status != PNP_READY){
                pnp_info("res: Disable failed becuase the PnP device '%s' is busy.", dev->dev.bus_id);