Commit 1499ead3 authored by Alex Dubov's avatar Alex Dubov Committed by Pierre Ossman

tifm_7xx1: simplify eject function

Eject function can take advantage of the socket_id field instead of explicit
pointer comparison.
Signed-off-by: default avatarAlex Dubov <oakad@yahoo.com>
Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
parent 217334d1
...@@ -17,18 +17,12 @@ ...@@ -17,18 +17,12 @@
static void tifm_7xx1_eject(struct tifm_adapter *fm, struct tifm_dev *sock) static void tifm_7xx1_eject(struct tifm_adapter *fm, struct tifm_dev *sock)
{ {
int cnt;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&fm->lock, flags); spin_lock_irqsave(&fm->lock, flags);
if (!fm->inhibit_new_cards) { if (!fm->inhibit_new_cards) {
for (cnt = 0; cnt < fm->max_sockets; cnt++) { fm->remove_mask |= 1 << sock->socket_id;
if (fm->sockets[cnt] == sock) {
fm->remove_mask |= (1 << cnt);
queue_work(fm->wq, &fm->media_remover); queue_work(fm->wq, &fm->media_remover);
break;
}
}
} }
spin_unlock_irqrestore(&fm->lock, flags); spin_unlock_irqrestore(&fm->lock, flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment