summaryrefslogtreecommitdiff
path: root/drivers/pnp/driver.c
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-03-25 03:53:42 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-03-25 03:53:42 -0300
commit03dd4cb26d967f9588437b0fc9cc0e8353322bb7 (patch)
treefa581f6dc1c0596391690d1f67eceef3af8246dc /drivers/pnp/driver.c
parentd4e493caf788ef44982e131ff9c786546904d934 (diff)
Linux-libre 4.5-gnu
Diffstat (limited to 'drivers/pnp/driver.c')
-rw-r--r--drivers/pnp/driver.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index 153a493b5..63452f20e 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -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;
}