sparc: Convert to using %pOF instead of full_name
Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Cc: "David S. Miller" <davem@davemloft.net> Cc: sparclinux@vger.kernel.org Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f3180e1828
commit
a412c85aa8
|
@ -123,8 +123,7 @@ static int auxio_probe(struct platform_device *dev)
|
||||||
if (!auxio_register)
|
if (!auxio_register)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
printk(KERN_INFO "AUXIO: Found device at %s\n",
|
printk(KERN_INFO "AUXIO: Found device at %pOF\n", dp);
|
||||||
dp->full_name);
|
|
||||||
|
|
||||||
if (auxio_devtype == AUXIO_TYPE_EBUS)
|
if (auxio_devtype == AUXIO_TYPE_EBUS)
|
||||||
auxio_set_led(AUXIO_LED_ON);
|
auxio_set_led(AUXIO_LED_ON);
|
||||||
|
|
|
@ -464,8 +464,8 @@ static int jbusmc_probe(struct platform_device *op)
|
||||||
|
|
||||||
mc_list_add(&p->list);
|
mc_list_add(&p->list);
|
||||||
|
|
||||||
printk(KERN_INFO PFX "UltraSPARC-IIIi memory controller at %s\n",
|
printk(KERN_INFO PFX "UltraSPARC-IIIi memory controller at %pOF\n",
|
||||||
op->dev.of_node->full_name);
|
op->dev.of_node);
|
||||||
|
|
||||||
dev_set_drvdata(&op->dev, p);
|
dev_set_drvdata(&op->dev, p);
|
||||||
|
|
||||||
|
@ -747,8 +747,8 @@ static int chmc_probe(struct platform_device *op)
|
||||||
|
|
||||||
mc_list_add(&p->list);
|
mc_list_add(&p->list);
|
||||||
|
|
||||||
printk(KERN_INFO PFX "UltraSPARC-III memory controller at %s [%s]\n",
|
printk(KERN_INFO PFX "UltraSPARC-III memory controller at %pOF [%s]\n",
|
||||||
dp->full_name,
|
dp,
|
||||||
(p->layout_size ? "ACTIVE" : "INACTIVE"));
|
(p->layout_size ? "ACTIVE" : "INACTIVE"));
|
||||||
|
|
||||||
dev_set_drvdata(&op->dev, p);
|
dev_set_drvdata(&op->dev, p);
|
||||||
|
|
|
@ -324,8 +324,8 @@ static void __init build_device_resources(struct platform_device *op,
|
||||||
memset(r, 0, sizeof(*r));
|
memset(r, 0, sizeof(*r));
|
||||||
|
|
||||||
if (of_resource_verbose)
|
if (of_resource_verbose)
|
||||||
printk("%s reg[%d] -> %llx\n",
|
printk("%pOF reg[%d] -> %llx\n",
|
||||||
op->dev.of_node->full_name, index,
|
op->dev.of_node, index,
|
||||||
result);
|
result);
|
||||||
|
|
||||||
if (result != OF_BAD_ADDR) {
|
if (result != OF_BAD_ADDR) {
|
||||||
|
@ -386,8 +386,7 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
|
||||||
op->dev.dma_mask = &op->dev.coherent_dma_mask;
|
op->dev.dma_mask = &op->dev.coherent_dma_mask;
|
||||||
|
|
||||||
if (of_device_register(op)) {
|
if (of_device_register(op)) {
|
||||||
printk("%s: Could not register of device.\n",
|
printk("%pOF: Could not register of device.\n", dp);
|
||||||
dp->full_name);
|
|
||||||
kfree(op);
|
kfree(op);
|
||||||
op = NULL;
|
op = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,9 +341,9 @@ static void __init build_device_resources(struct platform_device *op,
|
||||||
|
|
||||||
/* Prevent overrunning the op->resources[] array. */
|
/* Prevent overrunning the op->resources[] array. */
|
||||||
if (num_reg > PROMREG_MAX) {
|
if (num_reg > PROMREG_MAX) {
|
||||||
printk(KERN_WARNING "%s: Too many regs (%d), "
|
printk(KERN_WARNING "%pOF: Too many regs (%d), "
|
||||||
"limiting to %d.\n",
|
"limiting to %d.\n",
|
||||||
op->dev.of_node->full_name, num_reg, PROMREG_MAX);
|
op->dev.of_node, num_reg, PROMREG_MAX);
|
||||||
num_reg = PROMREG_MAX;
|
num_reg = PROMREG_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -401,8 +401,8 @@ static void __init build_device_resources(struct platform_device *op,
|
||||||
memset(r, 0, sizeof(*r));
|
memset(r, 0, sizeof(*r));
|
||||||
|
|
||||||
if (of_resource_verbose)
|
if (of_resource_verbose)
|
||||||
printk("%s reg[%d] -> %llx\n",
|
printk("%pOF reg[%d] -> %llx\n",
|
||||||
op->dev.of_node->full_name, index,
|
op->dev.of_node, index,
|
||||||
result);
|
result);
|
||||||
|
|
||||||
if (result != OF_BAD_ADDR) {
|
if (result != OF_BAD_ADDR) {
|
||||||
|
@ -548,8 +548,8 @@ static unsigned int __init build_one_device_irq(struct platform_device *op,
|
||||||
dp->irq_trans->data);
|
dp->irq_trans->data);
|
||||||
|
|
||||||
if (of_irq_verbose)
|
if (of_irq_verbose)
|
||||||
printk("%s: direct translate %x --> %x\n",
|
printk("%pOF: direct translate %x --> %x\n",
|
||||||
dp->full_name, orig_irq, irq);
|
dp, orig_irq, irq);
|
||||||
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -579,10 +579,9 @@ static unsigned int __init build_one_device_irq(struct platform_device *op,
|
||||||
&irq);
|
&irq);
|
||||||
|
|
||||||
if (of_irq_verbose)
|
if (of_irq_verbose)
|
||||||
printk("%s: Apply [%s:%x] imap --> [%s:%x]\n",
|
printk("%pOF: Apply [%pOF:%x] imap --> [%pOF:%x]\n",
|
||||||
op->dev.of_node->full_name,
|
op->dev.of_node,
|
||||||
pp->full_name, this_orig_irq,
|
pp, this_orig_irq, iret, irq);
|
||||||
of_node_full_name(iret), irq);
|
|
||||||
|
|
||||||
if (!iret)
|
if (!iret)
|
||||||
break;
|
break;
|
||||||
|
@ -597,10 +596,10 @@ static unsigned int __init build_one_device_irq(struct platform_device *op,
|
||||||
|
|
||||||
irq = pci_irq_swizzle(dp, pp, irq);
|
irq = pci_irq_swizzle(dp, pp, irq);
|
||||||
if (of_irq_verbose)
|
if (of_irq_verbose)
|
||||||
printk("%s: PCI swizzle [%s] "
|
printk("%pOF: PCI swizzle [%pOF] "
|
||||||
"%x --> %x\n",
|
"%x --> %x\n",
|
||||||
op->dev.of_node->full_name,
|
op->dev.of_node,
|
||||||
pp->full_name, this_orig_irq,
|
pp, this_orig_irq,
|
||||||
irq);
|
irq);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -619,8 +618,8 @@ static unsigned int __init build_one_device_irq(struct platform_device *op,
|
||||||
irq = ip->irq_trans->irq_build(op->dev.of_node, irq,
|
irq = ip->irq_trans->irq_build(op->dev.of_node, irq,
|
||||||
ip->irq_trans->data);
|
ip->irq_trans->data);
|
||||||
if (of_irq_verbose)
|
if (of_irq_verbose)
|
||||||
printk("%s: Apply IRQ trans [%s] %x --> %x\n",
|
printk("%pOF: Apply IRQ trans [%pOF] %x --> %x\n",
|
||||||
op->dev.of_node->full_name, ip->full_name, orig_irq, irq);
|
op->dev.of_node, ip, orig_irq, irq);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
nid = of_node_to_nid(dp);
|
nid = of_node_to_nid(dp);
|
||||||
|
@ -656,9 +655,9 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
|
||||||
|
|
||||||
/* Prevent overrunning the op->irqs[] array. */
|
/* Prevent overrunning the op->irqs[] array. */
|
||||||
if (op->archdata.num_irqs > PROMINTR_MAX) {
|
if (op->archdata.num_irqs > PROMINTR_MAX) {
|
||||||
printk(KERN_WARNING "%s: Too many irqs (%d), "
|
printk(KERN_WARNING "%pOF: Too many irqs (%d), "
|
||||||
"limiting to %d.\n",
|
"limiting to %d.\n",
|
||||||
dp->full_name, op->archdata.num_irqs, PROMINTR_MAX);
|
dp, op->archdata.num_irqs, PROMINTR_MAX);
|
||||||
op->archdata.num_irqs = PROMINTR_MAX;
|
op->archdata.num_irqs = PROMINTR_MAX;
|
||||||
}
|
}
|
||||||
memcpy(op->archdata.irqs, irq, op->archdata.num_irqs * 4);
|
memcpy(op->archdata.irqs, irq, op->archdata.num_irqs * 4);
|
||||||
|
@ -680,8 +679,7 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
|
||||||
op->dev.dma_mask = &op->dev.coherent_dma_mask;
|
op->dev.dma_mask = &op->dev.coherent_dma_mask;
|
||||||
|
|
||||||
if (of_device_register(op)) {
|
if (of_device_register(op)) {
|
||||||
printk("%s: Could not register of device.\n",
|
printk("%pOF: Could not register of device.\n", dp);
|
||||||
dp->full_name);
|
|
||||||
kfree(op);
|
kfree(op);
|
||||||
op = NULL;
|
op = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -431,13 +431,13 @@ static void of_scan_pci_bridge(struct pci_pbm_info *pbm,
|
||||||
u64 size;
|
u64 size;
|
||||||
|
|
||||||
if (ofpci_verbose)
|
if (ofpci_verbose)
|
||||||
pci_info(dev, "of_scan_pci_bridge(%s)\n", node->full_name);
|
pci_info(dev, "of_scan_pci_bridge(%pOF)\n", node);
|
||||||
|
|
||||||
/* parse bus-range property */
|
/* parse bus-range property */
|
||||||
busrange = of_get_property(node, "bus-range", &len);
|
busrange = of_get_property(node, "bus-range", &len);
|
||||||
if (busrange == NULL || len != 8) {
|
if (busrange == NULL || len != 8) {
|
||||||
pci_info(dev, "Can't get bus-range for PCI-PCI bridge %s\n",
|
pci_info(dev, "Can't get bus-range for PCI-PCI bridge %pOF\n",
|
||||||
node->full_name);
|
node);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,8 +455,8 @@ static void of_scan_pci_bridge(struct pci_pbm_info *pbm,
|
||||||
|
|
||||||
bus = pci_add_new_bus(dev->bus, dev, busrange[0]);
|
bus = pci_add_new_bus(dev->bus, dev, busrange[0]);
|
||||||
if (!bus) {
|
if (!bus) {
|
||||||
pci_err(dev, "Failed to create pci bus for %s\n",
|
pci_err(dev, "Failed to create pci bus for %pOF\n",
|
||||||
node->full_name);
|
node);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,13 +512,13 @@ static void of_scan_pci_bridge(struct pci_pbm_info *pbm,
|
||||||
res = bus->resource[0];
|
res = bus->resource[0];
|
||||||
if (res->flags) {
|
if (res->flags) {
|
||||||
pci_err(dev, "ignoring extra I/O range"
|
pci_err(dev, "ignoring extra I/O range"
|
||||||
" for bridge %s\n", node->full_name);
|
" for bridge %pOF\n", node);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (i >= PCI_NUM_RESOURCES - PCI_BRIDGE_RESOURCES) {
|
if (i >= PCI_NUM_RESOURCES - PCI_BRIDGE_RESOURCES) {
|
||||||
pci_err(dev, "too many memory ranges"
|
pci_err(dev, "too many memory ranges"
|
||||||
" for bridge %s\n", node->full_name);
|
" for bridge %pOF\n", node);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
res = bus->resource[i];
|
res = bus->resource[i];
|
||||||
|
@ -554,14 +554,14 @@ static void pci_of_scan_bus(struct pci_pbm_info *pbm,
|
||||||
struct pci_dev *dev;
|
struct pci_dev *dev;
|
||||||
|
|
||||||
if (ofpci_verbose)
|
if (ofpci_verbose)
|
||||||
pci_info(bus, "scan_bus[%s] bus no %d\n",
|
pci_info(bus, "scan_bus[%pOF] bus no %d\n",
|
||||||
node->full_name, bus->number);
|
node, bus->number);
|
||||||
|
|
||||||
child = NULL;
|
child = NULL;
|
||||||
prev_devfn = -1;
|
prev_devfn = -1;
|
||||||
while ((child = of_get_next_child(node, child)) != NULL) {
|
while ((child = of_get_next_child(node, child)) != NULL) {
|
||||||
if (ofpci_verbose)
|
if (ofpci_verbose)
|
||||||
pci_info(bus, " * %s\n", child->full_name);
|
pci_info(bus, " * %pOF\n", child);
|
||||||
reg = of_get_property(child, "reg", ®len);
|
reg = of_get_property(child, "reg", ®len);
|
||||||
if (reg == NULL || reglen < 20)
|
if (reg == NULL || reglen < 20)
|
||||||
continue;
|
continue;
|
||||||
|
@ -598,7 +598,7 @@ show_pciobppath_attr(struct device * dev, struct device_attribute * attr, char *
|
||||||
pdev = to_pci_dev(dev);
|
pdev = to_pci_dev(dev);
|
||||||
dp = pdev->dev.of_node;
|
dp = pdev->dev.of_node;
|
||||||
|
|
||||||
return snprintf (buf, PAGE_SIZE, "%s\n", dp->full_name);
|
return snprintf (buf, PAGE_SIZE, "%pOF\n", dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DEVICE_ATTR(obppath, S_IRUSR | S_IRGRP | S_IROTH, show_pciobppath_attr, NULL);
|
static DEVICE_ATTR(obppath, S_IRUSR | S_IRGRP | S_IROTH, show_pciobppath_attr, NULL);
|
||||||
|
@ -698,7 +698,7 @@ struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm,
|
||||||
struct device_node *node = pbm->op->dev.of_node;
|
struct device_node *node = pbm->op->dev.of_node;
|
||||||
struct pci_bus *bus;
|
struct pci_bus *bus;
|
||||||
|
|
||||||
printk("PCI: Scanning PBM %s\n", node->full_name);
|
printk("PCI: Scanning PBM %pOF\n", node);
|
||||||
|
|
||||||
pci_add_resource_offset(&resources, &pbm->io_space,
|
pci_add_resource_offset(&resources, &pbm->io_space,
|
||||||
pbm->io_offset);
|
pbm->io_offset);
|
||||||
|
@ -714,8 +714,7 @@ struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm,
|
||||||
bus = pci_create_root_bus(parent, pbm->pci_first_busno, pbm->pci_ops,
|
bus = pci_create_root_bus(parent, pbm->pci_first_busno, pbm->pci_ops,
|
||||||
pbm, &resources);
|
pbm, &resources);
|
||||||
if (!bus) {
|
if (!bus) {
|
||||||
printk(KERN_ERR "Failed to create bus for %s\n",
|
printk(KERN_ERR "Failed to create bus for %pOF\n", node);
|
||||||
node->full_name);
|
|
||||||
pci_free_resource_list(&resources);
|
pci_free_resource_list(&resources);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1111,8 +1110,8 @@ static void pci_bus_slot_names(struct device_node *node, struct pci_bus *bus)
|
||||||
sp = prop->names;
|
sp = prop->names;
|
||||||
|
|
||||||
if (ofpci_verbose)
|
if (ofpci_verbose)
|
||||||
pci_info(bus, "Making slots for [%s] mask[0x%02x]\n",
|
pci_info(bus, "Making slots for [%pOF] mask[0x%02x]\n",
|
||||||
node->full_name, mask);
|
node, mask);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (mask) {
|
while (mask) {
|
||||||
|
|
|
@ -255,7 +255,7 @@ void __init of_console_init(void)
|
||||||
}
|
}
|
||||||
of_console_device = dp;
|
of_console_device = dp;
|
||||||
|
|
||||||
strcpy(of_console_path, dp->full_name);
|
sprintf(of_console_path, "%pOF", dp);
|
||||||
if (!strcmp(type, "serial")) {
|
if (!strcmp(type, "serial")) {
|
||||||
strcat(of_console_path,
|
strcat(of_console_path,
|
||||||
(skip ? ":b" : ":a"));
|
(skip ? ":b" : ":a"));
|
||||||
|
@ -295,7 +295,7 @@ void __init of_console_init(void)
|
||||||
of_console_device = dp;
|
of_console_device = dp;
|
||||||
|
|
||||||
if (prom_vers == PROM_V2) {
|
if (prom_vers == PROM_V2) {
|
||||||
strcpy(of_console_path, dp->full_name);
|
sprintf(of_console_path, "%pOF", dp);
|
||||||
switch (*romvec->pv_stdout) {
|
switch (*romvec->pv_stdout) {
|
||||||
case PROMDEV_TTYA:
|
case PROMDEV_TTYA:
|
||||||
strcat(of_console_path, ":a");
|
strcat(of_console_path, ":a");
|
||||||
|
|
|
@ -67,8 +67,8 @@ void sbus_set_sbus64(struct device *dev, int bursts)
|
||||||
|
|
||||||
regs = of_get_property(op->dev.of_node, "reg", NULL);
|
regs = of_get_property(op->dev.of_node, "reg", NULL);
|
||||||
if (!regs) {
|
if (!regs) {
|
||||||
printk(KERN_ERR "sbus_set_sbus64: Cannot find regs for %s\n",
|
printk(KERN_ERR "sbus_set_sbus64: Cannot find regs for %pOF\n",
|
||||||
op->dev.of_node->full_name);
|
op->dev.of_node);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
slot = regs->which_io;
|
slot = regs->which_io;
|
||||||
|
|
|
@ -361,15 +361,15 @@ static unsigned int sun4d_build_device_irq(struct platform_device *op,
|
||||||
* lacks a "board#" property, something is very wrong.
|
* lacks a "board#" property, something is very wrong.
|
||||||
*/
|
*/
|
||||||
if (!bus->parent || strcmp(bus->parent->name, bus_connection)) {
|
if (!bus->parent || strcmp(bus->parent->name, bus_connection)) {
|
||||||
printk(KERN_ERR "%s: Error, parent is not %s.\n",
|
printk(KERN_ERR "%pOF: Error, parent is not %s.\n",
|
||||||
bus->full_name, bus_connection);
|
bus, bus_connection);
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
board_parent = bus->parent;
|
board_parent = bus->parent;
|
||||||
board = of_getintprop_default(board_parent, "board#", -1);
|
board = of_getintprop_default(board_parent, "board#", -1);
|
||||||
if (board == -1) {
|
if (board == -1) {
|
||||||
printk(KERN_ERR "%s: Error, lacks board# property.\n",
|
printk(KERN_ERR "%pOF: Error, lacks board# property.\n",
|
||||||
board_parent->full_name);
|
board_parent);
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -445,8 +445,8 @@ static int rtc_probe(struct platform_device *op)
|
||||||
{
|
{
|
||||||
struct resource *r;
|
struct resource *r;
|
||||||
|
|
||||||
printk(KERN_INFO "%s: RTC regs at 0x%llx\n",
|
printk(KERN_INFO "%pOF: RTC regs at 0x%llx\n",
|
||||||
op->dev.of_node->full_name, op->resource[0].start);
|
op->dev.of_node, op->resource[0].start);
|
||||||
|
|
||||||
/* The CMOS RTC driver only accepts IORESOURCE_IO, so cons
|
/* The CMOS RTC driver only accepts IORESOURCE_IO, so cons
|
||||||
* up a fake resource so that the probe works for all cases.
|
* up a fake resource so that the probe works for all cases.
|
||||||
|
@ -501,8 +501,8 @@ static struct platform_device rtc_bq4802_device = {
|
||||||
static int bq4802_probe(struct platform_device *op)
|
static int bq4802_probe(struct platform_device *op)
|
||||||
{
|
{
|
||||||
|
|
||||||
printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n",
|
printk(KERN_INFO "%pOF: BQ4802 regs at 0x%llx\n",
|
||||||
op->dev.of_node->full_name, op->resource[0].start);
|
op->dev.of_node, op->resource[0].start);
|
||||||
|
|
||||||
rtc_bq4802_device.resource = &op->resource[0];
|
rtc_bq4802_device.resource = &op->resource[0];
|
||||||
return platform_device_register(&rtc_bq4802_device);
|
return platform_device_register(&rtc_bq4802_device);
|
||||||
|
@ -565,8 +565,8 @@ static int mostek_probe(struct platform_device *op)
|
||||||
strcmp(dp->parent->parent->name, "central") != 0)
|
strcmp(dp->parent->parent->name, "central") != 0)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
printk(KERN_INFO "%s: Mostek regs at 0x%llx\n",
|
printk(KERN_INFO "%pOF: Mostek regs at 0x%llx\n",
|
||||||
dp->full_name, op->resource[0].start);
|
dp, op->resource[0].start);
|
||||||
|
|
||||||
m48t59_rtc.resource = &op->resource[0];
|
m48t59_rtc.resource = &op->resource[0];
|
||||||
return platform_device_register(&m48t59_rtc);
|
return platform_device_register(&m48t59_rtc);
|
||||||
|
|
|
@ -193,7 +193,7 @@ show_pciobppath_attr(struct device *dev, struct device_attribute *attr,
|
||||||
vdev = to_vio_dev(dev);
|
vdev = to_vio_dev(dev);
|
||||||
dp = vdev->dp;
|
dp = vdev->dp;
|
||||||
|
|
||||||
return snprintf (buf, PAGE_SIZE, "%s\n", dp->full_name);
|
return snprintf (buf, PAGE_SIZE, "%pOF\n", dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DEVICE_ATTR(obppath, S_IRUSR | S_IRGRP | S_IROTH,
|
static DEVICE_ATTR(obppath, S_IRUSR | S_IRGRP | S_IROTH,
|
||||||
|
|
Loading…
Reference in New Issue