Commit 1d7e6cca authored by Kay Sievers's avatar Kay Sievers Committed by Greg Kroah-Hartman

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

Signed-off-by: default avatarKay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0252c3b4
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#undef DEBUG #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; static struct macio_chip *macio_on_hold;
...@@ -240,7 +240,7 @@ static void macio_create_fixup_irq(struct macio_dev *dev, int index, ...@@ -240,7 +240,7 @@ static void macio_create_fixup_irq(struct macio_dev *dev, int index,
if (irq != NO_IRQ) { if (irq != NO_IRQ) {
dev->interrupt[index].start = irq; dev->interrupt[index].start = irq;
dev->interrupt[index].flags = IORESOURCE_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) if (dev->n_interrupts <= index)
dev->n_interrupts = index + 1; dev->n_interrupts = index + 1;
...@@ -303,7 +303,7 @@ static void macio_setup_interrupts(struct macio_dev *dev) ...@@ -303,7 +303,7 @@ static void macio_setup_interrupts(struct macio_dev *dev)
break; break;
res->start = irq; res->start = irq;
res->flags = IORESOURCE_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)) { if (macio_resource_quirks(np, res, i - 1)) {
memset(res, 0, sizeof(struct resource)); memset(res, 0, sizeof(struct resource));
continue; continue;
...@@ -325,7 +325,7 @@ static void macio_setup_resources(struct macio_dev *dev, ...@@ -325,7 +325,7 @@ static void macio_setup_resources(struct macio_dev *dev,
if (index >= MACIO_DEV_COUNT_RESOURCES) if (index >= MACIO_DEV_COUNT_RESOURCES)
break; break;
*res = r; *res = r;
res->name = dev->ofdev.dev.bus_id; res->name = dev_name(&dev->ofdev.dev);
if (macio_resource_quirks(np, res, index)) { if (macio_resource_quirks(np, res, index)) {
memset(res, 0, sizeof(struct resource)); memset(res, 0, sizeof(struct resource));
...@@ -338,7 +338,7 @@ static void macio_setup_resources(struct macio_dev *dev, ...@@ -338,7 +338,7 @@ static void macio_setup_resources(struct macio_dev *dev,
if (insert_resource(parent_res, res)) { if (insert_resource(parent_res, res)) {
printk(KERN_WARNING "Can't request resource " printk(KERN_WARNING "Can't request resource "
"%d for MacIO device %s\n", "%d for MacIO device %s\n",
index, dev->ofdev.dev.bus_id); index, dev_name(&dev->ofdev.dev));
} }
} }
dev->n_resources = index; dev->n_resources = index;
...@@ -385,7 +385,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, ...@@ -385,7 +385,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
/* MacIO itself has a different reg, we use it's PCI base */ /* MacIO itself has a different reg, we use it's PCI base */
if (np == chip->of_node) { if (np == chip->of_node) {
sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s", dev_set_name(&dev->ofdev.dev, "%1d.%08x:%.*s",
chip->lbus.index, chip->lbus.index,
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
(unsigned int)pci_resource_start(chip->lbus.pdev, 0), (unsigned int)pci_resource_start(chip->lbus.pdev, 0),
...@@ -395,7 +395,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, ...@@ -395,7 +395,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
MAX_NODE_NAME_SIZE, np->name); MAX_NODE_NAME_SIZE, np->name);
} else { } else {
reg = of_get_property(np, "reg", NULL); reg = of_get_property(np, "reg", NULL);
sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s", dev_set_name(&dev->ofdev.dev, "%1d.%08x:%.*s",
chip->lbus.index, chip->lbus.index,
reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name); reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name);
} }
...@@ -408,7 +408,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, ...@@ -408,7 +408,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
/* Register with core */ /* Register with core */
if (of_device_register(&dev->ofdev) != 0) { if (of_device_register(&dev->ofdev) != 0) {
printk(KERN_DEBUG"macio: device registration error for %s!\n", printk(KERN_DEBUG"macio: device registration error for %s!\n",
dev->ofdev.dev.bus_id); dev_name(&dev->ofdev.dev));
kfree(dev); kfree(dev);
return NULL; return NULL;
} }
...@@ -558,7 +558,7 @@ err_out: ...@@ -558,7 +558,7 @@ err_out:
resource_no, resource_no,
macio_resource_len(dev, resource_no), macio_resource_len(dev, resource_no),
macio_resource_start(dev, resource_no), macio_resource_start(dev, resource_no),
dev->ofdev.dev.bus_id); dev_name(&dev->ofdev.dev));
return -EBUSY; return -EBUSY;
} }
......
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