diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-03-18 22:39:55 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-03-18 22:39:55 +0100 |
commit | 38f6b38dbb0896511c509fbb6ceabbedbee8e87d (patch) | |
tree | 00553b841e8af3add37162c6a189991d7dba30df /drivers/pnp/driver.c | |
parent | aee94467d9858b5441c278ffa39dcd19bef548cf (diff) | |
download | lwn-38f6b38dbb0896511c509fbb6ceabbedbee8e87d.tar.gz lwn-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.c | 10 |
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); } |