aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/ds.c
diff options
context:
space:
mode:
authorBrice Goglin <Brice.Goglin@ens-lyon.org>2005-09-09 16:03:29 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 16:57:48 -0400
commitbd65a68574b787304a0cd90f22cfd44540ce3695 (patch)
treed3a1b36b28a270509304be29f8e17bcb66ee2350 /drivers/pcmcia/ds.c
parentd3feb1844ad33911ab1fe9df1ead66082b3bce9b (diff)
[PATCH] pcmcia: add pcmcia to IRQ information
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>
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r--drivers/pcmcia/ds.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 398146e3823e..080608c7381a 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -354,6 +354,7 @@ static void pcmcia_release_dev(struct device *dev)
354 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); 354 struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
355 ds_dbg(1, "releasing dev %p\n", p_dev); 355 ds_dbg(1, "releasing dev %p\n", p_dev);
356 pcmcia_put_socket(p_dev->socket); 356 pcmcia_put_socket(p_dev->socket);
357 kfree(p_dev->devname);
357 kfree(p_dev); 358 kfree(p_dev);
358} 359}
359 360
@@ -504,6 +505,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
504{ 505{
505 struct pcmcia_device *p_dev; 506 struct pcmcia_device *p_dev;
506 unsigned long flags; 507 unsigned long flags;
508 int bus_id_len;
507 509
508 s = pcmcia_get_socket(s); 510 s = pcmcia_get_socket(s);
509 if (!s) 511 if (!s)
@@ -527,7 +529,12 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
527 p_dev->dev.bus = &pcmcia_bus_type; 529 p_dev->dev.bus = &pcmcia_bus_type;
528 p_dev->dev.parent = s->dev.dev; 530 p_dev->dev.parent = s->dev.dev;
529 p_dev->dev.release = pcmcia_release_dev; 531 p_dev->dev.release = pcmcia_release_dev;
530 sprintf (p_dev->dev.bus_id, "%d.%d", p_dev->socket->sock, p_dev->device_no); 532 bus_id_len = sprintf (p_dev->dev.bus_id, "%d.%d", p_dev->socket->sock, p_dev->device_no);
533
534 p_dev->devname = kmalloc(6 + bus_id_len + 1, GFP_KERNEL);
535 if (!p_dev->devname)
536 goto err_free;
537 sprintf (p_dev->devname, "pcmcia%s", p_dev->dev.bus_id);
531 538
532 /* compat */ 539 /* compat */
533 p_dev->state = CLIENT_UNBOUND; 540 p_dev->state = CLIENT_UNBOUND;
@@ -552,6 +559,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
552 return p_dev; 559 return p_dev;
553 560
554 err_free: 561 err_free:
562 kfree(p_dev->devname);
555 kfree(p_dev); 563 kfree(p_dev);
556 s->device_count--; 564 s->device_count--;
557 err_put: 565 err_put: