Skip to content

Commit

Permalink
pcmcia: struct device - replace bus_id with dev_name(), dev_set_name()
Browse files Browse the repository at this point in the history
Signed-Off-By: Kay Sievers <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
  • Loading branch information
kaysievers authored and Dominik Brodowski committed Nov 2, 2008
1 parent 3e879f6 commit 2509698
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion drivers/pcmcia/cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
/* set proper values in socket->dev */
dev_set_drvdata(&socket->dev, socket);
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 */
socket->cis_mem.flags = 0;
Expand Down
9 changes: 4 additions & 5 deletions drivers/pcmcia/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,6 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
{
struct pcmcia_device *p_dev, *tmp_dev;
unsigned long flags;
int bus_id_len;

s = pcmcia_get_socket(s);
if (!s)
Expand Down Expand Up @@ -650,12 +649,12 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
/* by default don't allow DMA */
p_dev->dma_mask = DMA_MASK_NONE;
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);

p_dev->devname = kmalloc(6 + bus_id_len + 1, GFP_KERNEL);
dev_set_name(&p_dev->dev, "%d.%d", p_dev->socket->sock, p_dev->device_no);
if (!dev_name(&p_dev->dev))
goto err_free;
p_dev->devname = kasprintf(GFP_KERNEL, "pcmcia%s", dev_name(&p_dev->dev));
if (!p_dev->devname)
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);

spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
Expand Down
6 changes: 3 additions & 3 deletions drivers/pcmcia/rsrc_nonstatic.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static DEFINE_MUTEX(rsrc_mutex);
======================================================================*/

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);

Expand Down Expand Up @@ -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,
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 pcmcia_align_data data;
unsigned long min = base;
Expand Down Expand Up @@ -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,
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 pcmcia_align_data data;
unsigned long min, max;
Expand Down

0 comments on commit 2509698

Please sign in to comment.