summaryrefslogtreecommitdiffstats
path: root/drivers/pnp/driver.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-03-18 22:39:55 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-03-18 22:39:55 +0100
commit38f6b38dbb0896511c509fbb6ceabbedbee8e87d (patch)
tree00553b841e8af3add37162c6a189991d7dba30df /drivers/pnp/driver.c
parentPNP: tty/serial/8250/8250_fintek: Use module_pnp_driver to register driver (diff)
downloadlinux-38f6b38dbb0896511c509fbb6ceabbedbee8e87d.tar.xz
linux-38f6b38dbb0896511c509fbb6ceabbedbee8e87d.zip
PNP: Convert pnp_lock into a mutex
pnp_lock is a spinlock, but it is only acquired from process context, so it may be a mutex just fine. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/pnp/driver.c')
-rw-r--r--drivers/pnp/driver.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index 4e57d3370368..153a493b5413 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -58,22 +58,22 @@ static const struct pnp_device_id *match_device(struct pnp_driver *drv,
int pnp_device_attach(struct pnp_dev *pnp_dev)
{
- spin_lock(&pnp_lock);
+ mutex_lock(&pnp_lock);
if (pnp_dev->status != PNP_READY) {
- spin_unlock(&pnp_lock);
+ mutex_unlock(&pnp_lock);
return -EBUSY;
}
pnp_dev->status = PNP_ATTACHED;
- spin_unlock(&pnp_lock);
+ mutex_unlock(&pnp_lock);
return 0;
}
void pnp_device_detach(struct pnp_dev *pnp_dev)
{
- spin_lock(&pnp_lock);
+ mutex_lock(&pnp_lock);
if (pnp_dev->status == PNP_ATTACHED)
pnp_dev->status = PNP_READY;
- spin_unlock(&pnp_lock);
+ mutex_unlock(&pnp_lock);
pnp_disable_dev(pnp_dev);
}