aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/ds.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r--drivers/pcmcia/ds.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 00eee1435dca..47cab31ff6e4 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -622,7 +622,6 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
622{ 622{
623 struct pcmcia_device *p_dev, *tmp_dev; 623 struct pcmcia_device *p_dev, *tmp_dev;
624 unsigned long flags; 624 unsigned long flags;
625 int bus_id_len;
626 625
627 s = pcmcia_get_socket(s); 626 s = pcmcia_get_socket(s);
628 if (!s) 627 if (!s)
@@ -650,12 +649,12 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
650 /* by default don't allow DMA */ 649 /* by default don't allow DMA */
651 p_dev->dma_mask = DMA_MASK_NONE; 650 p_dev->dma_mask = DMA_MASK_NONE;
652 p_dev->dev.dma_mask = &p_dev->dma_mask; 651 p_dev->dev.dma_mask = &p_dev->dma_mask;
653 bus_id_len = sprintf (p_dev->dev.bus_id, "%d.%d", p_dev->socket->sock, p_dev->device_no); 652 dev_set_name(&p_dev->dev, "%d.%d", p_dev->socket->sock, p_dev->device_no);
654 653 if (!dev_name(&p_dev->dev))
655 p_dev->devname = kmalloc(6 + bus_id_len + 1, GFP_KERNEL); 654 goto err_free;
655 p_dev->devname = kasprintf(GFP_KERNEL, "pcmcia%s", dev_name(&p_dev->dev));
656 if (!p_dev->devname) 656 if (!p_dev->devname)
657 goto err_free; 657 goto err_free;
658 sprintf (p_dev->devname, "pcmcia%s", p_dev->dev.bus_id);
659 ds_dev_dbg(3, &p_dev->dev, "devname is %s\n", p_dev->devname); 658 ds_dev_dbg(3, &p_dev->dev, "devname is %s\n", p_dev->devname);
660 659
661 spin_lock_irqsave(&pcmcia_dev_list_lock, flags); 660 spin_lock_irqsave(&pcmcia_dev_list_lock, flags);