diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-03-18 17:39:55 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-03-18 17:39:55 -0400 |
commit | 38f6b38dbb0896511c509fbb6ceabbedbee8e87d (patch) | |
tree | 00553b841e8af3add37162c6a189991d7dba30df /drivers/pnp/driver.c | |
parent | aee94467d9858b5441c278ffa39dcd19bef548cf (diff) |
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, | |||
58 | 58 | ||
59 | int pnp_device_attach(struct pnp_dev *pnp_dev) | 59 | int pnp_device_attach(struct pnp_dev *pnp_dev) |
60 | { | 60 | { |
61 | spin_lock(&pnp_lock); | 61 | mutex_lock(&pnp_lock); |
62 | if (pnp_dev->status != PNP_READY) { | 62 | if (pnp_dev->status != PNP_READY) { |
63 | spin_unlock(&pnp_lock); | 63 | mutex_unlock(&pnp_lock); |
64 | return -EBUSY; | 64 | return -EBUSY; |
65 | } | 65 | } |
66 | pnp_dev->status = PNP_ATTACHED; | 66 | pnp_dev->status = PNP_ATTACHED; |
67 | spin_unlock(&pnp_lock); | 67 | mutex_unlock(&pnp_lock); |
68 | return 0; | 68 | return 0; |
69 | } | 69 | } |
70 | 70 | ||
71 | void pnp_device_detach(struct pnp_dev *pnp_dev) | 71 | void pnp_device_detach(struct pnp_dev *pnp_dev) |
72 | { | 72 | { |
73 | spin_lock(&pnp_lock); | 73 | mutex_lock(&pnp_lock); |
74 | if (pnp_dev->status == PNP_ATTACHED) | 74 | if (pnp_dev->status == PNP_ATTACHED) |
75 | pnp_dev->status = PNP_READY; | 75 | pnp_dev->status = PNP_READY; |
76 | spin_unlock(&pnp_lock); | 76 | mutex_unlock(&pnp_lock); |
77 | pnp_disable_dev(pnp_dev); | 77 | pnp_disable_dev(pnp_dev); |
78 | } | 78 | } |
79 | 79 | ||