Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192523
b: refs/heads/master
c: a60f22c
h: refs/heads/master
i:
  192521: 34872a1
  192519: 248115e
v: v3
  • Loading branch information
Dominik Brodowski committed May 10, 2010
1 parent e08b389 commit 3b05ce1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d59622e52c296cad8702c483a0092f428b794ef
refs/heads/master: a60f22c4af3382b86301d64d6a9d68f30191d4c9
18 changes: 2 additions & 16 deletions trunk/drivers/pcmcia/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,15 +477,6 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev)
}


/* device_add_lock is needed to avoid double registration by cardmgr and kernel.
* Serializes pcmcia_device_add; will most likely be removed in future.
*
* While it has the caveat that adding new PCMCIA devices inside(!) device_register()
* won't work, this doesn't matter much at the moment: the driver core doesn't
* support it either.
*/
static DEFINE_MUTEX(device_add_lock);

struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int function)
{
struct pcmcia_device *p_dev, *tmp_dev;
Expand All @@ -495,8 +486,6 @@ struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int fu
if (!s)
return NULL;

mutex_lock(&device_add_lock);

pr_debug("adding device to %d, function %d\n", s->sock, function);

p_dev = kzalloc(sizeof(struct pcmcia_device), GFP_KERNEL);
Expand Down Expand Up @@ -536,8 +525,8 @@ struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int fu

/*
* p_dev->function_config must be the same for all card functions.
* Note that this is serialized by the device_add_lock, so that
* only one such struct will be created.
* Note that this is serialized by ops_mutex, so that only one
* such struct will be created.
*/
list_for_each_entry(tmp_dev, &s->devices_list, socket_device_list)
if (p_dev->func == tmp_dev->func) {
Expand Down Expand Up @@ -575,8 +564,6 @@ struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int fu
if (device_register(&p_dev->dev))
goto err_unreg;

mutex_unlock(&device_add_lock);

return p_dev;

err_unreg:
Expand All @@ -594,7 +581,6 @@ struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int fu
kfree(p_dev->devname);
kfree(p_dev);
err_put:
mutex_unlock(&device_add_lock);
pcmcia_put_socket(s);

return NULL;
Expand Down

0 comments on commit 3b05ce1

Please sign in to comment.