]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/pnp/driver.c
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / drivers / pnp / driver.c
index 153a493b5413e06482dd9909bf0301e6d26eae1f..63452f20e3e97e5f567cec533ac74a4ab100ebf8 100644 (file)
@@ -74,7 +74,6 @@ void pnp_device_detach(struct pnp_dev *pnp_dev)
        if (pnp_dev->status == PNP_ATTACHED)
                pnp_dev->status = PNP_READY;
        mutex_unlock(&pnp_lock);
-       pnp_disable_dev(pnp_dev);
 }
 
 static int pnp_device_probe(struct device *dev)
@@ -131,6 +130,11 @@ static int pnp_device_remove(struct device *dev)
                        drv->remove(pnp_dev);
                pnp_dev->driver = NULL;
        }
+
+       if (pnp_dev->active &&
+           (!drv || !(drv->flags & PNP_DRIVER_RES_DO_NOT_CHANGE)))
+               pnp_disable_dev(pnp_dev);
+
        pnp_device_detach(pnp_dev);
        return 0;
 }