From 65194c7a1087b80d387bdb7d687639aa4c558073 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Fri, 9 Sep 2005 13:03:29 -0700 Subject: [PATCH] --- yaml --- r: 8163 b: refs/heads/master c: bd65a68574b787304a0cd90f22cfd44540ce3695 h: refs/heads/master i: 8161: 3eb212061779b0944b3e9f74c2c1030c6bccf0ae 8159: ad005b4a0bfa8ab5d8dc329f46c562aacd88efd5 v: v3 --- [refs] | 2 +- trunk/drivers/pcmcia/ds.c | 10 +++++++++- trunk/drivers/pcmcia/pcmcia_resource.c | 4 ++-- trunk/include/pcmcia/ds.h | 2 ++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 047f7f1d36d8..8d0940d8eedb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d3feb1844ad33911ab1fe9df1ead66082b3bce9b +refs/heads/master: bd65a68574b787304a0cd90f22cfd44540ce3695 diff --git a/trunk/drivers/pcmcia/ds.c b/trunk/drivers/pcmcia/ds.c index 398146e3823e..080608c7381a 100644 --- a/trunk/drivers/pcmcia/ds.c +++ b/trunk/drivers/pcmcia/ds.c @@ -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: diff --git a/trunk/drivers/pcmcia/pcmcia_resource.c b/trunk/drivers/pcmcia/pcmcia_resource.c index deb6d00bc2ff..89022ad5b520 100644 --- a/trunk/drivers/pcmcia/pcmcia_resource.c +++ b/trunk/drivers/pcmcia/pcmcia_resource.c @@ -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; } diff --git a/trunk/include/pcmcia/ds.h b/trunk/include/pcmcia/ds.h index b707a603351b..cb8b6e6ce66c 100644 --- a/trunk/include/pcmcia/ds.h +++ b/trunk/include/pcmcia/ds.h @@ -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