Skip to content

Commit

Permalink
macintosh: struct device - replace bus_id with dev_name(), dev_set_na…
Browse files Browse the repository at this point in the history
…me()

Signed-off-by: Kay Sievers <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
kaysievers authored and gregkh committed Jan 6, 2009
1 parent 0252c3b commit 1d7e6cc
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions drivers/macintosh/macio_asic.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#undef DEBUG

#define MAX_NODE_NAME_SIZE (BUS_ID_SIZE - 12)
#define MAX_NODE_NAME_SIZE (20 - 12)

static struct macio_chip *macio_on_hold;

Expand Down Expand Up @@ -240,7 +240,7 @@ static void macio_create_fixup_irq(struct macio_dev *dev, int index,
if (irq != NO_IRQ) {
dev->interrupt[index].start = irq;
dev->interrupt[index].flags = IORESOURCE_IRQ;
dev->interrupt[index].name = dev->ofdev.dev.bus_id;
dev->interrupt[index].name = dev_name(&dev->ofdev.dev);
}
if (dev->n_interrupts <= index)
dev->n_interrupts = index + 1;
Expand Down Expand Up @@ -303,7 +303,7 @@ static void macio_setup_interrupts(struct macio_dev *dev)
break;
res->start = irq;
res->flags = IORESOURCE_IRQ;
res->name = dev->ofdev.dev.bus_id;
res->name = dev_name(&dev->ofdev.dev);
if (macio_resource_quirks(np, res, i - 1)) {
memset(res, 0, sizeof(struct resource));
continue;
Expand All @@ -325,7 +325,7 @@ static void macio_setup_resources(struct macio_dev *dev,
if (index >= MACIO_DEV_COUNT_RESOURCES)
break;
*res = r;
res->name = dev->ofdev.dev.bus_id;
res->name = dev_name(&dev->ofdev.dev);

if (macio_resource_quirks(np, res, index)) {
memset(res, 0, sizeof(struct resource));
Expand All @@ -338,7 +338,7 @@ static void macio_setup_resources(struct macio_dev *dev,
if (insert_resource(parent_res, res)) {
printk(KERN_WARNING "Can't request resource "
"%d for MacIO device %s\n",
index, dev->ofdev.dev.bus_id);
index, dev_name(&dev->ofdev.dev));
}
}
dev->n_resources = index;
Expand Down Expand Up @@ -385,8 +385,8 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,

/* MacIO itself has a different reg, we use it's PCI base */
if (np == chip->of_node) {
sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s",
chip->lbus.index,
dev_set_name(&dev->ofdev.dev, "%1d.%08x:%.*s",
chip->lbus.index,
#ifdef CONFIG_PCI
(unsigned int)pci_resource_start(chip->lbus.pdev, 0),
#else
Expand All @@ -395,9 +395,9 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
MAX_NODE_NAME_SIZE, np->name);
} else {
reg = of_get_property(np, "reg", NULL);
sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s",
chip->lbus.index,
reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name);
dev_set_name(&dev->ofdev.dev, "%1d.%08x:%.*s",
chip->lbus.index,
reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name);
}

/* Setup interrupts & resources */
Expand All @@ -408,7 +408,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
/* Register with core */
if (of_device_register(&dev->ofdev) != 0) {
printk(KERN_DEBUG"macio: device registration error for %s!\n",
dev->ofdev.dev.bus_id);
dev_name(&dev->ofdev.dev));
kfree(dev);
return NULL;
}
Expand Down Expand Up @@ -558,7 +558,7 @@ int macio_request_resource(struct macio_dev *dev, int resource_no,
resource_no,
macio_resource_len(dev, resource_no),
macio_resource_start(dev, resource_no),
dev->ofdev.dev.bus_id);
dev_name(&dev->ofdev.dev));
return -EBUSY;
}

Expand Down

0 comments on commit 1d7e6cc

Please sign in to comment.