From: Alex Dubov Date: Sun, 10 Dec 2006 14:55:32 +0000 (+1100) Subject: tifm_7xx1: simplify eject function X-Git-Tag: v2.6.21-rc2~42^2~20^2~17 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=1499ead31ede528a657c50761c4780c40f929d6d;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Pierre Ossman --- diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c index 7fbf5d58bfc..24b20a417a2 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); }