aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pcmcia/ds.c10
-rw-r--r--drivers/pcmcia/pcmcia_resource.c4
2 files changed, 11 insertions, 3 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:
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index deb6d00bc2ff..89022ad5b520 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -820,7 +820,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
820 ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) || 820 ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) ||
821 (s->functions > 1) || 821 (s->functions > 1) ||
822 (irq == s->pci_irq)) ? SA_SHIRQ : 0, 822 (irq == s->pci_irq)) ? SA_SHIRQ : 0,
823 p_dev->dev.bus_id, 823 p_dev->devname,
824 (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Instance : data); 824 (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Instance : data);
825 if (!ret) { 825 if (!ret) {
826 if (!(req->Attributes & IRQ_HANDLE_PRESENT)) 826 if (!(req->Attributes & IRQ_HANDLE_PRESENT))
@@ -842,7 +842,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
842 ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) || 842 ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) ||
843 (s->functions > 1) || 843 (s->functions > 1) ||
844 (irq == s->pci_irq)) ? SA_SHIRQ : 0, 844 (irq == s->pci_irq)) ? SA_SHIRQ : 0,
845 p_dev->dev.bus_id, req->Instance)) 845 p_dev->devname, req->Instance))
846 return CS_IN_USE; 846 return CS_IN_USE;
847 } 847 }
848 848