init_completion(&socket->socket_released);
init_completion(&socket->thread_done);
- init_waitqueue_head(&socket->thread_wait);
mutex_init(&socket->skt_mutex);
spin_lock_init(&socket->thread_lock);
cs_dbg(socket, 0, "pcmcia_unregister_socket(0x%p)\n", socket->ops);
- if (socket->thread) {
- wake_up(&socket->thread_wait);
+ if (socket->thread)
kthread_stop(socket->thread);
- }
+
release_cis_mem(socket);
/* remove from our own list */
static int pccardd(void *__skt)
{
struct pcmcia_socket *skt = __skt;
- DECLARE_WAITQUEUE(wait, current);
int ret;
skt->thread = current;
if (ret)
dev_warn(&skt->dev, "err %d adding socket attributes\n", ret);
- add_wait_queue(&skt->thread_wait, &wait);
complete(&skt->thread_done);
set_freezable();
/* make sure we are running before we exit */
set_current_state(TASK_RUNNING);
- remove_wait_queue(&skt->thread_wait, &wait);
-
/* remove from the device core */
pccard_sysfs_remove_socket(&skt->dev);
device_unregister(&skt->dev);
s->thread_events |= events;
spin_unlock_irqrestore(&s->thread_lock, flags);
- wake_up(&s->thread_wait);
+ wake_up_process(s->thread);
}
} /* pcmcia_parse_events */
EXPORT_SYMBOL(pcmcia_parse_events);