aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Dubov <oakad@yahoo.com>2006-12-10 09:55:32 -0500
committerPierre Ossman <drzeus@drzeus.cx>2007-02-04 14:54:09 -0500
commit1499ead31ede528a657c50761c4780c40f929d6d (patch)
tree20c43f7a6a85d2726a74ae712b9e8017008e0ed6
parent217334d14d28e6a671e6dd2c7a35c9070b0721ea (diff)
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>
-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 @@
17 17
18static void tifm_7xx1_eject(struct tifm_adapter *fm, struct tifm_dev *sock) 18static void tifm_7xx1_eject(struct tifm_adapter *fm, struct tifm_dev *sock)
19{ 19{
20 int cnt;
21 unsigned long flags; 20 unsigned long flags;
22 21
23 spin_lock_irqsave(&fm->lock, flags); 22 spin_lock_irqsave(&fm->lock, flags);
24 if (!fm->inhibit_new_cards) { 23 if (!fm->inhibit_new_cards) {
25 for (cnt = 0; cnt < fm->max_sockets; cnt++) { 24 fm->remove_mask |= 1 << sock->socket_id;
26 if (fm->sockets[cnt] == sock) { 25 queue_work(fm->wq, &fm->media_remover);
27 fm->remove_mask |= (1 << cnt);
28 queue_work(fm->wq, &fm->media_remover);
29 break;
30 }
31 }
32 } 26 }
33 spin_unlock_irqrestore(&fm->lock, flags); 27 spin_unlock_irqrestore(&fm->lock, flags);
34} 28}