1
0
Fork 0

tifm_7xx1: simplify eject function

Eject function can take advantage of the socket_id field instead of explicit
pointer comparison.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
hifive-unleashed-5.1
Alex Dubov 2006-12-11 01:55:32 +11:00 committed by Pierre Ossman
parent 217334d14d
commit 1499ead31e
1 changed files with 2 additions and 8 deletions

View File

@ -17,18 +17,12 @@
static void tifm_7xx1_eject(struct tifm_adapter *fm, struct tifm_dev *sock)
{
int cnt;
unsigned long flags;
spin_lock_irqsave(&fm->lock, flags);
if (!fm->inhibit_new_cards) {
for (cnt = 0; cnt < fm->max_sockets; cnt++) {
if (fm->sockets[cnt] == sock) {
fm->remove_mask |= (1 << cnt);
queue_work(fm->wq, &fm->media_remover);
break;
}
}
fm->remove_mask |= 1 << sock->socket_id;
queue_work(fm->wq, &fm->media_remover);
}
spin_unlock_irqrestore(&fm->lock, flags);
}