pcmcia: cs: kill thread_wait
There is not reason to have a waitqueue if it's always the same thread that is waiting for it. Just use wake_up_process instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Small modification: Also remove unused variable. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
committed by
Dominik Brodowski
parent
2df697036b
commit
0b40209419
@@ -238,7 +238,6 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
|
|||||||
|
|
||||||
init_completion(&socket->socket_released);
|
init_completion(&socket->socket_released);
|
||||||
init_completion(&socket->thread_done);
|
init_completion(&socket->thread_done);
|
||||||
init_waitqueue_head(&socket->thread_wait);
|
|
||||||
mutex_init(&socket->skt_mutex);
|
mutex_init(&socket->skt_mutex);
|
||||||
spin_lock_init(&socket->thread_lock);
|
spin_lock_init(&socket->thread_lock);
|
||||||
|
|
||||||
@@ -278,10 +277,9 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
|
|||||||
|
|
||||||
cs_dbg(socket, 0, "pcmcia_unregister_socket(0x%p)\n", socket->ops);
|
cs_dbg(socket, 0, "pcmcia_unregister_socket(0x%p)\n", socket->ops);
|
||||||
|
|
||||||
if (socket->thread) {
|
if (socket->thread)
|
||||||
wake_up(&socket->thread_wait);
|
|
||||||
kthread_stop(socket->thread);
|
kthread_stop(socket->thread);
|
||||||
}
|
|
||||||
release_cis_mem(socket);
|
release_cis_mem(socket);
|
||||||
|
|
||||||
/* remove from our own list */
|
/* remove from our own list */
|
||||||
@@ -635,7 +633,6 @@ static void socket_detect_change(struct pcmcia_socket *skt)
|
|||||||
static int pccardd(void *__skt)
|
static int pccardd(void *__skt)
|
||||||
{
|
{
|
||||||
struct pcmcia_socket *skt = __skt;
|
struct pcmcia_socket *skt = __skt;
|
||||||
DECLARE_WAITQUEUE(wait, current);
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
skt->thread = current;
|
skt->thread = current;
|
||||||
@@ -656,7 +653,6 @@ static int pccardd(void *__skt)
|
|||||||
if (ret)
|
if (ret)
|
||||||
dev_warn(&skt->dev, "err %d adding socket attributes\n", ret);
|
dev_warn(&skt->dev, "err %d adding socket attributes\n", ret);
|
||||||
|
|
||||||
add_wait_queue(&skt->thread_wait, &wait);
|
|
||||||
complete(&skt->thread_done);
|
complete(&skt->thread_done);
|
||||||
|
|
||||||
set_freezable();
|
set_freezable();
|
||||||
@@ -694,8 +690,6 @@ static int pccardd(void *__skt)
|
|||||||
/* make sure we are running before we exit */
|
/* make sure we are running before we exit */
|
||||||
set_current_state(TASK_RUNNING);
|
set_current_state(TASK_RUNNING);
|
||||||
|
|
||||||
remove_wait_queue(&skt->thread_wait, &wait);
|
|
||||||
|
|
||||||
/* remove from the device core */
|
/* remove from the device core */
|
||||||
pccard_sysfs_remove_socket(&skt->dev);
|
pccard_sysfs_remove_socket(&skt->dev);
|
||||||
device_unregister(&skt->dev);
|
device_unregister(&skt->dev);
|
||||||
@@ -716,7 +710,7 @@ void pcmcia_parse_events(struct pcmcia_socket *s, u_int events)
|
|||||||
s->thread_events |= events;
|
s->thread_events |= events;
|
||||||
spin_unlock_irqrestore(&s->thread_lock, flags);
|
spin_unlock_irqrestore(&s->thread_lock, flags);
|
||||||
|
|
||||||
wake_up(&s->thread_wait);
|
wake_up_process(s->thread);
|
||||||
}
|
}
|
||||||
} /* pcmcia_parse_events */
|
} /* pcmcia_parse_events */
|
||||||
EXPORT_SYMBOL(pcmcia_parse_events);
|
EXPORT_SYMBOL(pcmcia_parse_events);
|
||||||
|
@@ -245,7 +245,6 @@ struct pcmcia_socket {
|
|||||||
|
|
||||||
struct task_struct *thread;
|
struct task_struct *thread;
|
||||||
struct completion thread_done;
|
struct completion thread_done;
|
||||||
wait_queue_head_t thread_wait;
|
|
||||||
spinlock_t thread_lock; /* protects thread_events */
|
spinlock_t thread_lock; /* protects thread_events */
|
||||||
unsigned int thread_events;
|
unsigned int thread_events;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user