]> err.no Git - linux-2.6/commitdiff
[PATCH] pcmcia: add pcmcia to IRQ information
authorBrice Goglin <Brice.Goglin@ens-lyon.org>
Fri, 9 Sep 2005 20:03:29 +0000 (13:03 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 9 Sep 2005 20:57:48 +0000 (13:57 -0700)
Add a devname parameter to the pcmcia_device structure, fills it with
"pcmcia<bus_id>" in pcmcia_device_add, and passes it to request_irq in
pcmcia_request_irq.

Signed-off-by: Brice Goglin <Brice.Goglin@ens-lyon.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/pcmcia/ds.c
drivers/pcmcia/pcmcia_resource.c
include/pcmcia/ds.h

index 398146e3823e1b1632e426de67158972b60bd3f9..080608c7381a749226fb9d136dbd39f19ec7a380 100644 (file)
@@ -354,6 +354,7 @@ static void pcmcia_release_dev(struct device *dev)
        struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
        ds_dbg(1, "releasing dev %p\n", p_dev);
        pcmcia_put_socket(p_dev->socket);
+       kfree(p_dev->devname);
        kfree(p_dev);
 }
 
@@ -504,6 +505,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
 {
        struct pcmcia_device *p_dev;
        unsigned long flags;
+       int bus_id_len;
 
        s = pcmcia_get_socket(s);
        if (!s)
@@ -527,7 +529,12 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
        p_dev->dev.bus = &pcmcia_bus_type;
        p_dev->dev.parent = s->dev.dev;
        p_dev->dev.release = pcmcia_release_dev;
-       sprintf (p_dev->dev.bus_id, "%d.%d", p_dev->socket->sock, p_dev->device_no);
+       bus_id_len = sprintf (p_dev->dev.bus_id, "%d.%d", p_dev->socket->sock, p_dev->device_no);
+
+       p_dev->devname = kmalloc(6 + bus_id_len + 1, GFP_KERNEL);
+       if (!p_dev->devname)
+               goto err_free;
+       sprintf (p_dev->devname, "pcmcia%s", p_dev->dev.bus_id);
 
        /* compat */
        p_dev->state = CLIENT_UNBOUND;
@@ -552,6 +559,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
        return p_dev;
 
  err_free:
+       kfree(p_dev->devname);
        kfree(p_dev);
        s->device_count--;
  err_put:
index deb6d00bc2ff5c365ebf0f79796cfab949428f97..89022ad5b5207eeac9b90898478f8e49b4088174 100644 (file)
@@ -820,7 +820,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
                                          ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) ||
                                           (s->functions > 1) ||
                                           (irq == s->pci_irq)) ? SA_SHIRQ : 0,
-                                         p_dev->dev.bus_id,
+                                         p_dev->devname,
                                          (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Instance : data);
                        if (!ret) {
                                if (!(req->Attributes & IRQ_HANDLE_PRESENT))
@@ -842,7 +842,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
                                ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) ||
                                 (s->functions > 1) ||
                                 (irq == s->pci_irq)) ? SA_SHIRQ : 0,
-                               p_dev->dev.bus_id, req->Instance))
+                               p_dev->devname, req->Instance))
                        return CS_IN_USE;
        }
 
index b707a603351b2217b6aecaeca3b7e81155b38d9e..cb8b6e6ce66c9dc192aefc705aaa4999b07b82b8 100644 (file)
@@ -151,6 +151,8 @@ struct pcmcia_device {
           uniquely define a pcmcia_device */
        struct pcmcia_socket    *socket;
 
+       char                    *devname;
+
        u8                      device_no;
 
        /* the hardware "function" device; certain subdevices can