diff options
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); |