Commit 25096986 authored by Kay Sievers's avatar Kay Sievers Committed by Dominik Brodowski

pcmcia: struct device - replace bus_id with dev_name(), dev_set_name()

Signed-Off-By: default avatarKay Sievers <kay.sievers@vrfy.org>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 3e879f61
...@@ -226,7 +226,7 @@ int pcmcia_register_socket(struct pcmcia_socket *socket) ...@@ -226,7 +226,7 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
/* set proper values in socket->dev */ /* set proper values in socket->dev */
dev_set_drvdata(&socket->dev, socket); dev_set_drvdata(&socket->dev, socket);
socket->dev.class = &pcmcia_socket_class; socket->dev.class = &pcmcia_socket_class;
snprintf(socket->dev.bus_id, BUS_ID_SIZE, "pcmcia_socket%u", socket->sock); dev_set_name(&socket->dev, "pcmcia_socket%u", socket->sock);
/* base address = 0, map = 0 */ /* base address = 0, map = 0 */
socket->cis_mem.flags = 0; socket->cis_mem.flags = 0;
......
...@@ -622,7 +622,6 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f ...@@ -622,7 +622,6 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
{ {
struct pcmcia_device *p_dev, *tmp_dev; struct pcmcia_device *p_dev, *tmp_dev;
unsigned long flags; unsigned long flags;
int bus_id_len;
s = pcmcia_get_socket(s); s = pcmcia_get_socket(s);
if (!s) if (!s)
...@@ -650,12 +649,12 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f ...@@ -650,12 +649,12 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
/* by default don't allow DMA */ /* by default don't allow DMA */
p_dev->dma_mask = DMA_MASK_NONE; p_dev->dma_mask = DMA_MASK_NONE;
p_dev->dev.dma_mask = &p_dev->dma_mask; p_dev->dev.dma_mask = &p_dev->dma_mask;
bus_id_len = sprintf (p_dev->dev.bus_id, "%d.%d", p_dev->socket->sock, p_dev->device_no); dev_set_name(&p_dev->dev, "%d.%d", p_dev->socket->sock, p_dev->device_no);
if (!dev_name(&p_dev->dev))
p_dev->devname = kmalloc(6 + bus_id_len + 1, GFP_KERNEL); goto err_free;
p_dev->devname = kasprintf(GFP_KERNEL, "pcmcia%s", dev_name(&p_dev->dev));
if (!p_dev->devname) if (!p_dev->devname)
goto err_free; goto err_free;
sprintf (p_dev->devname, "pcmcia%s", p_dev->dev.bus_id);
ds_dev_dbg(3, &p_dev->dev, "devname is %s\n", p_dev->devname); ds_dev_dbg(3, &p_dev->dev, "devname is %s\n", p_dev->devname);
spin_lock_irqsave(&pcmcia_dev_list_lock, flags); spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
......
...@@ -71,7 +71,7 @@ static DEFINE_MUTEX(rsrc_mutex); ...@@ -71,7 +71,7 @@ static DEFINE_MUTEX(rsrc_mutex);
======================================================================*/ ======================================================================*/
static struct resource * static struct resource *
make_resource(resource_size_t b, resource_size_t n, int flags, char *name) make_resource(resource_size_t b, resource_size_t n, int flags, const char *name)
{ {
struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL); struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
...@@ -624,7 +624,7 @@ static int nonstatic_adjust_io_region(struct resource *res, unsigned long r_star ...@@ -624,7 +624,7 @@ static int nonstatic_adjust_io_region(struct resource *res, unsigned long r_star
static struct resource *nonstatic_find_io_region(unsigned long base, int num, static struct resource *nonstatic_find_io_region(unsigned long base, int num,
unsigned long align, struct pcmcia_socket *s) unsigned long align, struct pcmcia_socket *s)
{ {
struct resource *res = make_resource(0, num, IORESOURCE_IO, s->dev.bus_id); struct resource *res = make_resource(0, num, IORESOURCE_IO, dev_name(&s->dev));
struct socket_data *s_data = s->resource_data; struct socket_data *s_data = s->resource_data;
struct pcmcia_align_data data; struct pcmcia_align_data data;
unsigned long min = base; unsigned long min = base;
...@@ -658,7 +658,7 @@ static struct resource *nonstatic_find_io_region(unsigned long base, int num, ...@@ -658,7 +658,7 @@ static struct resource *nonstatic_find_io_region(unsigned long base, int num,
static struct resource * nonstatic_find_mem_region(u_long base, u_long num, static struct resource * nonstatic_find_mem_region(u_long base, u_long num,
u_long align, int low, struct pcmcia_socket *s) u_long align, int low, struct pcmcia_socket *s)
{ {
struct resource *res = make_resource(0, num, IORESOURCE_MEM, s->dev.bus_id); struct resource *res = make_resource(0, num, IORESOURCE_MEM, dev_name(&s->dev));
struct socket_data *s_data = s->resource_data; struct socket_data *s_data = s->resource_data;
struct pcmcia_align_data data; struct pcmcia_align_data data;
unsigned long min, max; unsigned long min, max;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment