tifm_7xx1: simplify eject function
authorAlex Dubov <oakad@yahoo.com>
Sun, 10 Dec 2006 14:55:32 +0000 (01:55 +1100)
committerPierre Ossman <drzeus@drzeus.cx>
Sun, 4 Feb 2007 19:54:09 +0000 (20:54 +0100)
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>
drivers/misc/tifm_7xx1.c

index 7fbf5d58bfc506f913b8bb4c3fbc5fff41290e59..24b20a417a23bdc353302f51df0ab6bf8c2986f1 100644 (file)
 
 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);
 }