diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-01-16 03:14:11 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-02-17 11:48:20 -0500 |
commit | 00ce99ff506a17882747a7d6874e3f5206a99043 (patch) | |
tree | 571f5b106f25f35f326d456123c4af85147c3bce /drivers/pcmcia/socket_sysfs.c | |
parent | 3d3de32fad19e37695e6649136e4cb17f9d46329 (diff) |
pcmcia: simplify locking
replace pcmcia_socket->lock and pcmcia_dev_list_lock by using the
per-socket "ops_mutex", as we do neither need different locks
nor a spinlock here.
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/socket_sysfs.c')
-rw-r--r-- | drivers/pcmcia/socket_sysfs.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/pcmcia/socket_sysfs.c b/drivers/pcmcia/socket_sysfs.c index 1cba9d38d813..e8826df00a36 100644 --- a/drivers/pcmcia/socket_sysfs.c +++ b/drivers/pcmcia/socket_sysfs.c | |||
@@ -189,16 +189,15 @@ static ssize_t pccard_store_resource(struct device *dev, | |||
189 | struct device_attribute *attr, | 189 | struct device_attribute *attr, |
190 | const char *buf, size_t count) | 190 | const char *buf, size_t count) |
191 | { | 191 | { |
192 | unsigned long flags; | ||
193 | struct pcmcia_socket *s = to_socket(dev); | 192 | struct pcmcia_socket *s = to_socket(dev); |
194 | 193 | ||
195 | if (!count) | 194 | if (!count) |
196 | return -EINVAL; | 195 | return -EINVAL; |
197 | 196 | ||
198 | spin_lock_irqsave(&s->lock, flags); | 197 | mutex_lock(&s->ops_mutex); |
199 | if (!s->resource_setup_done) | 198 | if (!s->resource_setup_done) |
200 | s->resource_setup_done = 1; | 199 | s->resource_setup_done = 1; |
201 | spin_unlock_irqrestore(&s->lock, flags); | 200 | mutex_unlock(&s->ops_mutex); |
202 | 201 | ||
203 | mutex_lock(&s->skt_mutex); | 202 | mutex_lock(&s->skt_mutex); |
204 | if ((s->callback) && | 203 | if ((s->callback) && |