aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-11-01 06:46:06 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2008-11-02 09:05:51 -0500
commit2509698687e2d8265a19d800f7daa6f87790a529 (patch)
tree1973afe1d18c08db899ed1c558a36abfd1d050c4 /drivers/pcmcia
parent3e879f61434632ca099804713099f8f1627f929e (diff)
pcmcia: struct device - replace bus_id with dev_name(), dev_set_name()
Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/cs.c2
-rw-r--r--drivers/pcmcia/ds.c9
-rw-r--r--drivers/pcmcia/rsrc_nonstatic.c6
3 files changed, 8 insertions, 9 deletions
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index c68c5d338285..5d0e60e09d31 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -226,7 +226,7 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
226 /* set proper values in socket->dev */ 226 /* set proper values in socket->dev */
227 dev_set_drvdata(&socket->dev, socket); 227 dev_set_drvdata(&socket->dev, socket);
228 socket->dev.class = &pcmcia_socket_class; 228 socket->dev.class = &pcmcia_socket_class;
229 snprintf(socket->dev.bus_id, BUS_ID_SIZE, "pcmcia_socket%u", socket->sock); 229 dev_set_name(&socket->dev, "pcmcia_socket%u", socket->sock);
230 230
231 /* base address = 0, map = 0 */ 231 /* base address = 0, map = 0 */
232 socket->cis_mem.flags = 0; 232 socket->cis_mem.flags = 0;
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);
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 17f4ecf1c0c5..9ca22c7aafb2 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -71,7 +71,7 @@ static DEFINE_MUTEX(rsrc_mutex);
71======================================================================*/ 71======================================================================*/
72 72
73static struct resource * 73static struct resource *
74make_resource(resource_size_t b, resource_size_t n, int flags, char *name) 74make_resource(resource_size_t b, resource_size_t n, int flags, const char *name)
75{ 75{
76 struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL); 76 struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
77 77
@@ -624,7 +624,7 @@ static int nonstatic_adjust_io_region(struct resource *res, unsigned long r_star
624static struct resource *nonstatic_find_io_region(unsigned long base, int num, 624static struct resource *nonstatic_find_io_region(unsigned long base, int num,
625 unsigned long align, struct pcmcia_socket *s) 625 unsigned long align, struct pcmcia_socket *s)
626{ 626{
627 struct resource *res = make_resource(0, num, IORESOURCE_IO, s->dev.bus_id); 627 struct resource *res = make_resource(0, num, IORESOURCE_IO, dev_name(&s->dev));
628 struct socket_data *s_data = s->resource_data; 628 struct socket_data *s_data = s->resource_data;
629 struct pcmcia_align_data data; 629 struct pcmcia_align_data data;
630 unsigned long min = base; 630 unsigned long min = base;
@@ -658,7 +658,7 @@ static struct resource *nonstatic_find_io_region(unsigned long base, int num,
658static struct resource * nonstatic_find_mem_region(u_long base, u_long num, 658static struct resource * nonstatic_find_mem_region(u_long base, u_long num,
659 u_long align, int low, struct pcmcia_socket *s) 659 u_long align, int low, struct pcmcia_socket *s)
660{ 660{
661 struct resource *res = make_resource(0, num, IORESOURCE_MEM, s->dev.bus_id); 661 struct resource *res = make_resource(0, num, IORESOURCE_MEM, dev_name(&s->dev));
662 struct socket_data *s_data = s->resource_data; 662 struct socket_data *s_data = s->resource_data;
663 struct pcmcia_align_data data; 663 struct pcmcia_align_data data;
664 unsigned long min, max; 664 unsigned long min, max;