linux-mips
[Top] [All Lists]

[PATCH] pcmcia/vrc4171: use local spinlock for device local lock.

To: Dominik Brodowski <linux@dominikbrodowski.net>
Subject: [PATCH] pcmcia/vrc4171: use local spinlock for device local lock.
From: Yoichi Yuasa <yuasa@linux-mips.org>
Date: Wed, 10 Mar 2010 15:57:56 +0900
Cc: yuasa@linux-mips.org, linux-pcmcia@lists.infradead.org, Ralf Baechle <ralf@linux-mips.org>, linux-mips <linux-mips@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:message-id:x-mailer:mime-version:content-type :content-transfer-encoding; bh=pJYmVtfvtWBiMBqPM7ZKJBJ+05zUgjG4Mm6xy8XMIcs=; b=VuCRCHrOGiZ8mLAmzkGjdLS1dxHg53gEDUzqH8RP85xqdanlsjvPCIUsMSenCmdU/C X/7PVhV5Y6B512TtGBDdKYZ39UO/zIcowVQekRUy7iM1cyxMjA0Ubkk8Hk4LMxcdls77 0x6V6oKh2mcugGj/1tFjbMPKROTLvWFMJ3lSw=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; b=ZeFAWJ7Ns0TLYqrjlOyI1GuzV/sjX/iuZzufhSryh+jOk6L9qZhKZxxLpEwyhPIpOh /u3ubrfZ/JgJKJEZC5ynb9Wnuf978l20ZWOoXDRPO6BBhEd0FzuwRx5VZfgXjvoYhPF0 tvoyd4XrMnf6UCEttXAmmIZy3VeSKu4GkAMrs=
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
struct pcmcia_socket lock had been used before.

Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
---
 drivers/pcmcia/vrc4171_card.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c
index c9fcbdc..aaccdb9 100644
--- a/drivers/pcmcia/vrc4171_card.c
+++ b/drivers/pcmcia/vrc4171_card.c
@@ -105,6 +105,7 @@ typedef struct vrc4171_socket {
        char name[24];
        int csc_irq;
        int io_irq;
+       spinlock_t lock;
 } vrc4171_socket_t;
 
 static vrc4171_socket_t vrc4171_sockets[CARD_MAX_SLOTS];
@@ -327,7 +328,7 @@ static int pccard_set_socket(struct pcmcia_socket *sock, 
socket_state_t *state)
        slot = sock->sock;
        socket = &vrc4171_sockets[slot];
 
-       spin_lock_irq(&sock->lock);
+       spin_lock_irq(&socket->lock);
 
        voltage = set_Vcc_value(state->Vcc);
        exca_write_byte(slot, CARD_VOLTAGE_SELECT, voltage);
@@ -370,7 +371,7 @@ static int pccard_set_socket(struct pcmcia_socket *sock, 
socket_state_t *state)
                cscint |= I365_CSC_DETECT;
         exca_write_byte(slot, I365_CSCINT, cscint);
 
-       spin_unlock_irq(&sock->lock);
+       spin_unlock_irq(&socket->lock);
 
        return 0;
 }
-- 
1.7.0.2


<Prev in Thread] Current Thread [Next in Thread>