summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorAlex Dubov <oakad@yahoo.com>2006-12-11 01:55:32 +1100
committerPierre Ossman <drzeus@drzeus.cx>2007-02-04 20:54:09 +0100
commit1499ead31ede528a657c50761c4780c40f929d6d (patch)
tree20c43f7a6a85d2726a74ae712b9e8017008e0ed6 /drivers/misc
parent217334d14d28e6a671e6dd2c7a35c9070b0721ea (diff)
downloadlinux-1499ead31ede528a657c50761c4780c40f929d6d.tar.bz2
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>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/tifm_7xx1.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c
index 7fbf5d58bfc5..24b20a417a23 100644
--- a/drivers/misc/tifm_7xx1.c
+++ b/drivers/misc/tifm_7xx1.c
@@ -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);
}