diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-01-17 13:31:45 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-02-17 11:48:24 -0500 |
commit | cfe5d809518eda3d5e2da87c5ccbe8647143573a (patch) | |
tree | dd61ec285412fc0de8090ef5743b824447a9eeda /drivers/pcmcia/cs.c | |
parent | 3f565232c561fbd9d5e03354aac29b90cb2bc78a (diff) |
pcmcia: use ops_mutex for rsrc_{mgr,nonstatic} locking
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/cs.c')
-rw-r--r-- | drivers/pcmcia/cs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c index 13277eebe46a..7ba45b0cca6b 100644 --- a/drivers/pcmcia/cs.c +++ b/drivers/pcmcia/cs.c | |||
@@ -224,7 +224,9 @@ int pcmcia_register_socket(struct pcmcia_socket *socket) | |||
224 | spin_lock_init(&socket->thread_lock); | 224 | spin_lock_init(&socket->thread_lock); |
225 | 225 | ||
226 | if (socket->resource_ops->init) { | 226 | if (socket->resource_ops->init) { |
227 | mutex_lock(&socket->ops_mutex); | ||
227 | ret = socket->resource_ops->init(socket); | 228 | ret = socket->resource_ops->init(socket); |
229 | mutex_unlock(&socket->ops_mutex); | ||
228 | if (ret) | 230 | if (ret) |
229 | goto err; | 231 | goto err; |
230 | } | 232 | } |
@@ -282,8 +284,11 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket) | |||
282 | up_write(&pcmcia_socket_list_rwsem); | 284 | up_write(&pcmcia_socket_list_rwsem); |
283 | 285 | ||
284 | /* wait for sysfs to drop all references */ | 286 | /* wait for sysfs to drop all references */ |
285 | if (socket->resource_ops->exit) | 287 | if (socket->resource_ops->exit) { |
288 | mutex_lock(&socket->ops_mutex); | ||
286 | socket->resource_ops->exit(socket); | 289 | socket->resource_ops->exit(socket); |
290 | mutex_unlock(&socket->ops_mutex); | ||
291 | } | ||
287 | wait_for_completion(&socket->socket_released); | 292 | wait_for_completion(&socket->socket_released); |
288 | } /* pcmcia_unregister_socket */ | 293 | } /* pcmcia_unregister_socket */ |
289 | EXPORT_SYMBOL(pcmcia_unregister_socket); | 294 | EXPORT_SYMBOL(pcmcia_unregister_socket); |