Skip to content

Commit f14121a

Browse files
committed
Merge tag 'dt-for-3.6' of git://sources.calxeda.com/kernel/linux
Pull devicetree updates from Rob Herring: "A small set of changes for devicetree: - Couple of Documentation fixes - Addition of new helper function of_node_full_name - Improve of_parse_phandle_with_args return values - Some NULL related sparse fixes" Grant's busy packing. * tag 'dt-for-3.6' of git://sources.calxeda.com/kernel/linux: of: mtd: nuke useless const qualifier devicetree: add helper inline for retrieving a node's full name of: return -ENOENT when no property usage-model.txt: fix typo machine_init->init_machine of: Fix null pointer related warnings in base.c file LED: Fix missing semicolon in OF documentation of: fix a few typos in the binding documentation
2 parents 914311c + e95d8aa commit f14121a

15 files changed

Lines changed: 34 additions & 30 deletions

File tree

‎Documentation/devicetree/bindings/gpio/led.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ run-control {
5555
gpios = <&mpc8572 7 0>;
5656
default-state = "on";
5757
};
58-
}
58+
};

‎Documentation/devicetree/bindings/mtd/partition.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ flash@0 {
3535
uimage@100000 {
3636
reg = <0x0100000 0x200000>;
3737
};
38-
];
38+
};

‎Documentation/devicetree/usage-model.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ device tree for the NVIDIA Tegra board.
312312
};
313313
};
314314

315-
At .machine_init() time, Tegra board support code will need to look at
315+
At .init_machine() time, Tegra board support code will need to look at
316316
this DT and decide which nodes to create platform_devices for.
317317
However, looking at the tree, it is not immediately obvious what kind
318318
of device each node represents, or even if a node represents a device

‎arch/microblaze/pci/pci-common.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,7 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
249249
} else {
250250
pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
251251
oirq.size, oirq.specifier[0], oirq.specifier[1],
252-
oirq.controller ? oirq.controller->full_name :
253-
"<default>");
252+
of_node_full_name(oirq.controller));
254253

255254
virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
256255
oirq.size);
@@ -1493,8 +1492,7 @@ static void __devinit pcibios_scan_phb(struct pci_controller *hose)
14931492
struct pci_bus *bus;
14941493
struct device_node *node = hose->dn;
14951494

1496-
pr_debug("PCI: Scanning PHB %s\n",
1497-
node ? node->full_name : "<NO NAME>");
1495+
pr_debug("PCI: Scanning PHB %s\n", of_node_full_name(node));
14981496

14991497
pcibios_setup_phb_resources(hose, &resources);
15001498

‎arch/powerpc/kernel/pci-common.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,7 @@ static int pci_read_irq_line(struct pci_dev *pci_dev)
248248
} else {
249249
pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
250250
oirq.size, oirq.specifier[0], oirq.specifier[1],
251-
oirq.controller ? oirq.controller->full_name :
252-
"<default>");
251+
of_node_full_name(oirq.controller));
253252

254253
virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
255254
oirq.size);
@@ -1628,8 +1627,7 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose)
16281627
struct device_node *node = hose->dn;
16291628
int mode;
16301629

1631-
pr_debug("PCI: Scanning PHB %s\n",
1632-
node ? node->full_name : "<NO NAME>");
1630+
pr_debug("PCI: Scanning PHB %s\n", of_node_full_name(node));
16331631

16341632
/* Get some IO space for the new PHB */
16351633
pcibios_setup_phb_io_space(hose);

‎arch/powerpc/kernel/vio.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,8 +1294,7 @@ static void __devinit vio_dev_release(struct device *dev)
12941294
struct iommu_table *tbl = get_iommu_table_base(dev);
12951295

12961296
if (tbl)
1297-
iommu_free_table(tbl, dev->of_node ?
1298-
dev->of_node->full_name : dev_name(dev));
1297+
iommu_free_table(tbl, of_node_full_name(dev->of_node));
12991298
of_node_put(dev->of_node);
13001299
kfree(to_vio_dev(dev));
13011300
}
@@ -1519,7 +1518,7 @@ static ssize_t devspec_show(struct device *dev,
15191518
{
15201519
struct device_node *of_node = dev->of_node;
15211520

1522-
return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none");
1521+
return sprintf(buf, "%s\n", of_node_full_name(of_node));
15231522
}
15241523

15251524
static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,

‎arch/powerpc/platforms/cell/iommu.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,7 @@ static struct iommu_table *cell_get_iommu_table(struct device *dev)
551551
iommu = cell_iommu_for_node(dev_to_node(dev));
552552
if (iommu == NULL || list_empty(&iommu->windows)) {
553553
printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n",
554-
dev->of_node ? dev->of_node->full_name : "?",
555-
dev_to_node(dev));
554+
of_node_full_name(dev->of_node), dev_to_node(dev));
556555
return NULL;
557556
}
558557
window = list_entry(iommu->windows.next, struct iommu_window, list);

‎arch/powerpc/platforms/pseries/iommu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
11341134
if (!pdn || !PCI_DN(pdn)) {
11351135
printk(KERN_WARNING "pci_dma_dev_setup_pSeriesLP: "
11361136
"no DMA window found for pci dev=%s dn=%s\n",
1137-
pci_name(dev), dn? dn->full_name : "<null>");
1137+
pci_name(dev), of_node_full_name(dn));
11381138
return;
11391139
}
11401140
pr_debug(" parent is %s\n", pdn->full_name);

‎arch/sparc/kernel/of_device_64.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ static unsigned int __init build_one_device_irq(struct platform_device *op,
580580
printk("%s: Apply [%s:%x] imap --> [%s:%x]\n",
581581
op->dev.of_node->full_name,
582582
pp->full_name, this_orig_irq,
583-
(iret ? iret->full_name : "NULL"), irq);
583+
of_node_full_name(iret), irq);
584584

585585
if (!iret)
586586
break;

‎drivers/of/base.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ struct property *of_find_property(const struct device_node *np,
173173
return NULL;
174174

175175
read_lock(&devtree_lock);
176-
for (pp = np->properties; pp != 0; pp = pp->next) {
176+
for (pp = np->properties; pp; pp = pp->next) {
177177
if (of_prop_cmp(pp->name, name) == 0) {
178-
if (lenp != 0)
178+
if (lenp)
179179
*lenp = pp->length;
180180
break;
181181
}
@@ -497,7 +497,7 @@ struct device_node *of_find_node_with_property(struct device_node *from,
497497
read_lock(&devtree_lock);
498498
np = from ? from->allnext : allnodes;
499499
for (; np; np = np->allnext) {
500-
for (pp = np->properties; pp != 0; pp = pp->next) {
500+
for (pp = np->properties; pp; pp = pp->next) {
501501
if (of_prop_cmp(pp->name, prop_name) == 0) {
502502
of_node_get(np);
503503
goto out;
@@ -902,7 +902,7 @@ int of_parse_phandle_with_args(struct device_node *np, const char *list_name,
902902
/* Retrieve the phandle list property */
903903
list = of_get_property(np, list_name, &size);
904904
if (!list)
905-
return -EINVAL;
905+
return -ENOENT;
906906
list_end = list + size / sizeof(*list);
907907

908908
/* Loop over the phandles until all the requested entry is found */
@@ -1180,7 +1180,7 @@ static void of_alias_add(struct alias_prop *ap, struct device_node *np,
11801180
ap->stem[stem_len] = 0;
11811181
list_add_tail(&ap->link, &aliases_lookup);
11821182
pr_debug("adding DT alias:%s: stem=%s id=%i node=%s\n",
1183-
ap->alias, ap->stem, ap->id, np ? np->full_name : NULL);
1183+
ap->alias, ap->stem, ap->id, of_node_full_name(np));
11841184
}
11851185

11861186
/**

0 commit comments

Comments
 (0)