Skip to content

Commit 0b40209

Browse files
Christoph HellwigDominik Brodowski
authored andcommitted
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>
1 parent 2df6970 commit 0b40209

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

‎drivers/pcmcia/cs.c‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
238238

239239
init_completion(&socket->socket_released);
240240
init_completion(&socket->thread_done);
241-
init_waitqueue_head(&socket->thread_wait);
242241
mutex_init(&socket->skt_mutex);
243242
spin_lock_init(&socket->thread_lock);
244243

@@ -278,10 +277,9 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
278277

279278
cs_dbg(socket, 0, "pcmcia_unregister_socket(0x%p)\n", socket->ops);
280279

281-
if (socket->thread) {
282-
wake_up(&socket->thread_wait);
280+
if (socket->thread)
283281
kthread_stop(socket->thread);
284-
}
282+
285283
release_cis_mem(socket);
286284

287285
/* remove from our own list */
@@ -635,7 +633,6 @@ static void socket_detect_change(struct pcmcia_socket *skt)
635633
static int pccardd(void *__skt)
636634
{
637635
struct pcmcia_socket *skt = __skt;
638-
DECLARE_WAITQUEUE(wait, current);
639636
int ret;
640637

641638
skt->thread = current;
@@ -656,7 +653,6 @@ static int pccardd(void *__skt)
656653
if (ret)
657654
dev_warn(&skt->dev, "err %d adding socket attributes\n", ret);
658655

659-
add_wait_queue(&skt->thread_wait, &wait);
660656
complete(&skt->thread_done);
661657

662658
set_freezable();
@@ -694,8 +690,6 @@ static int pccardd(void *__skt)
694690
/* make sure we are running before we exit */
695691
set_current_state(TASK_RUNNING);
696692

697-
remove_wait_queue(&skt->thread_wait, &wait);
698-
699693
/* remove from the device core */
700694
pccard_sysfs_remove_socket(&skt->dev);
701695
device_unregister(&skt->dev);
@@ -716,7 +710,7 @@ void pcmcia_parse_events(struct pcmcia_socket *s, u_int events)
716710
s->thread_events |= events;
717711
spin_unlock_irqrestore(&s->thread_lock, flags);
718712

719-
wake_up(&s->thread_wait);
713+
wake_up_process(s->thread);
720714
}
721715
} /* pcmcia_parse_events */
722716
EXPORT_SYMBOL(pcmcia_parse_events);

‎include/pcmcia/ss.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ struct pcmcia_socket {
245245

246246
struct task_struct *thread;
247247
struct completion thread_done;
248-
wait_queue_head_t thread_wait;
249248
spinlock_t thread_lock; /* protects thread_events */
250249
unsigned int thread_events;
251250

0 commit comments

Comments
 (0)