regulator: return set_mode is same mode is requested
[safe/jmp/linux-2.6] / drivers / pcmcia / ds.c
index 5fd2948..7ef7ade 100644 (file)
@@ -371,8 +371,6 @@ static int pcmcia_device_remove(struct device *dev)
        if (p_drv->remove)
                p_drv->remove(p_dev);
 
-       p_dev->dev_node = NULL;
-
        /* check for proper unloading */
        if (p_dev->_irq || p_dev->_io || p_dev->_locked)
                dev_printk(KERN_INFO, dev,
@@ -479,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;
@@ -497,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);
@@ -538,15 +525,14 @@ 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) {
                        p_dev->function_config = tmp_dev->function_config;
                        p_dev->io = tmp_dev->io;
                        p_dev->irq = tmp_dev->irq;
-                       p_dev->irq_v = tmp_dev->irq_v;
                        kref_get(&p_dev->function_config->ref);
                }
 
@@ -571,15 +557,13 @@ struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int fu
 
        dev_printk(KERN_NOTICE, &p_dev->dev,
                   "pcmcia: registering new device %s (IRQ: %d)\n",
-                  p_dev->devname, p_dev->irq_v);
+                  p_dev->devname, p_dev->irq);
 
        pcmcia_device_query(p_dev);
 
        if (device_register(&p_dev->dev))
                goto err_unreg;
 
-       mutex_unlock(&device_add_lock);
-
        return p_dev;
 
  err_unreg:
@@ -597,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;