aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-24 17:07:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-24 17:07:22 -0400
commitf14121ab35912e3d2e57ac9a4ce1f9d4b7baeffb (patch)
tree7d5b4799998760e0a88166185abff1147d4ee04d
parent914311c9fb9bc01a215de9d848b72b5449c0e342 (diff)
parente95d8aafa5d911bf523bc47fe89f3336eb8a1b51 (diff)
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
-rw-r--r--Documentation/devicetree/bindings/gpio/led.txt2
-rw-r--r--Documentation/devicetree/bindings/mtd/partition.txt2
-rw-r--r--Documentation/devicetree/usage-model.txt2
-rw-r--r--arch/microblaze/pci/pci-common.c6
-rw-r--r--arch/powerpc/kernel/pci-common.c6
-rw-r--r--arch/powerpc/kernel/vio.c5
-rw-r--r--arch/powerpc/platforms/cell/iommu.c3
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c2
-rw-r--r--arch/sparc/kernel/of_device_64.c2
-rw-r--r--drivers/of/base.c10
-rw-r--r--drivers/of/irq.c2
-rw-r--r--drivers/of/of_mtd.c2
-rw-r--r--include/linux/of.h10
-rw-r--r--include/linux/of_mtd.h2
-rw-r--r--kernel/irq/irqdomain.c8
15 files changed, 34 insertions, 30 deletions
diff --git a/Documentation/devicetree/bindings/gpio/led.txt b/Documentation/devicetree/bindings/gpio/led.txt
index fd2bd56e7195..9bb308abd221 100644
--- a/Documentation/devicetree/bindings/gpio/led.txt
+++ b/Documentation/devicetree/bindings/gpio/led.txt
@@ -55,4 +55,4 @@ run-control {
55 gpios = <&mpc8572 7 0>; 55 gpios = <&mpc8572 7 0>;
56 default-state = "on"; 56 default-state = "on";
57 }; 57 };
58} 58};
diff --git a/Documentation/devicetree/bindings/mtd/partition.txt b/Documentation/devicetree/bindings/mtd/partition.txt
index f114ce1657c2..6e1f61f1e789 100644
--- a/Documentation/devicetree/bindings/mtd/partition.txt
+++ b/Documentation/devicetree/bindings/mtd/partition.txt
@@ -35,4 +35,4 @@ flash@0 {
35 uimage@100000 { 35 uimage@100000 {
36 reg = <0x0100000 0x200000>; 36 reg = <0x0100000 0x200000>;
37 }; 37 };
38]; 38};
diff --git a/Documentation/devicetree/usage-model.txt b/Documentation/devicetree/usage-model.txt
index c5a80099b71c..dca90fe22a90 100644
--- a/Documentation/devicetree/usage-model.txt
+++ b/Documentation/devicetree/usage-model.txt
@@ -312,7 +312,7 @@ device tree for the NVIDIA Tegra board.
312 }; 312 };
313}; 313};
314 314
315At .machine_init() time, Tegra board support code will need to look at 315At .init_machine() time, Tegra board support code will need to look at
316this DT and decide which nodes to create platform_devices for. 316this DT and decide which nodes to create platform_devices for.
317However, looking at the tree, it is not immediately obvious what kind 317However, looking at the tree, it is not immediately obvious what kind
318of device each node represents, or even if a node represents a device 318of device each node represents, or even if a node represents a device
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
index ed22bfc5db14..ca8f6e769960 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -249,8 +249,7 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
249 } else { 249 } else {
250 pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n", 250 pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
251 oirq.size, oirq.specifier[0], oirq.specifier[1], 251 oirq.size, oirq.specifier[0], oirq.specifier[1],
252 oirq.controller ? oirq.controller->full_name : 252 of_node_full_name(oirq.controller));
253 "<default>");
254 253
255 virq = irq_create_of_mapping(oirq.controller, oirq.specifier, 254 virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
256 oirq.size); 255 oirq.size);
@@ -1493,8 +1492,7 @@ static void __devinit pcibios_scan_phb(struct pci_controller *hose)
1493 struct pci_bus *bus; 1492 struct pci_bus *bus;
1494 struct device_node *node = hose->dn; 1493 struct device_node *node = hose->dn;
1495 1494
1496 pr_debug("PCI: Scanning PHB %s\n", 1495 pr_debug("PCI: Scanning PHB %s\n", of_node_full_name(node));
1497 node ? node->full_name : "<NO NAME>");
1498 1496
1499 pcibios_setup_phb_resources(hose, &resources); 1497 pcibios_setup_phb_resources(hose, &resources);
1500 1498
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 0f75bd500404..edef9afd8858 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -248,8 +248,7 @@ static int pci_read_irq_line(struct pci_dev *pci_dev)
248 } else { 248 } else {
249 pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n", 249 pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
250 oirq.size, oirq.specifier[0], oirq.specifier[1], 250 oirq.size, oirq.specifier[0], oirq.specifier[1],
251 oirq.controller ? oirq.controller->full_name : 251 of_node_full_name(oirq.controller));
252 "<default>");
253 252
254 virq = irq_create_of_mapping(oirq.controller, oirq.specifier, 253 virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
255 oirq.size); 254 oirq.size);
@@ -1628,8 +1627,7 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose)
1628 struct device_node *node = hose->dn; 1627 struct device_node *node = hose->dn;
1629 int mode; 1628 int mode;
1630 1629
1631 pr_debug("PCI: Scanning PHB %s\n", 1630 pr_debug("PCI: Scanning PHB %s\n", of_node_full_name(node));
1632 node ? node->full_name : "<NO NAME>");
1633 1631
1634 /* Get some IO space for the new PHB */ 1632 /* Get some IO space for the new PHB */
1635 pcibios_setup_phb_io_space(hose); 1633 pcibios_setup_phb_io_space(hose);
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 7a421e8fe7ca..3052a931f2b5 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1294,8 +1294,7 @@ static void __devinit vio_dev_release(struct device *dev)
1294 struct iommu_table *tbl = get_iommu_table_base(dev); 1294 struct iommu_table *tbl = get_iommu_table_base(dev);
1295 1295
1296 if (tbl) 1296 if (tbl)
1297 iommu_free_table(tbl, dev->of_node ? 1297 iommu_free_table(tbl, of_node_full_name(dev->of_node));
1298 dev->of_node->full_name : dev_name(dev));
1299 of_node_put(dev->of_node); 1298 of_node_put(dev->of_node);
1300 kfree(to_vio_dev(dev)); 1299 kfree(to_vio_dev(dev));
1301} 1300}
@@ -1519,7 +1518,7 @@ static ssize_t devspec_show(struct device *dev,
1519{ 1518{
1520 struct device_node *of_node = dev->of_node; 1519 struct device_node *of_node = dev->of_node;
1521 1520
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));
1523} 1522}
1524 1523
1525static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, 1524static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index c264969c9319..dca213666747 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -551,8 +551,7 @@ static struct iommu_table *cell_get_iommu_table(struct device *dev)
551 iommu = cell_iommu_for_node(dev_to_node(dev)); 551 iommu = cell_iommu_for_node(dev_to_node(dev));
552 if (iommu == NULL || list_empty(&iommu->windows)) { 552 if (iommu == NULL || list_empty(&iommu->windows)) {
553 printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n", 553 printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n",
554 dev->of_node ? dev->of_node->full_name : "?", 554 of_node_full_name(dev->of_node), dev_to_node(dev));
555 dev_to_node(dev));
556 return NULL; 555 return NULL;
557 } 556 }
558 window = list_entry(iommu->windows.next, struct iommu_window, list); 557 window = list_entry(iommu->windows.next, struct iommu_window, list);
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 07c09cbbfb19..bca220f2873c 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -1134,7 +1134,7 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
1134 if (!pdn || !PCI_DN(pdn)) { 1134 if (!pdn || !PCI_DN(pdn)) {
1135 printk(KERN_WARNING "pci_dma_dev_setup_pSeriesLP: " 1135 printk(KERN_WARNING "pci_dma_dev_setup_pSeriesLP: "
1136 "no DMA window found for pci dev=%s dn=%s\n", 1136 "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));
1138 return; 1138 return;
1139 } 1139 }
1140 pr_debug(" parent is %s\n", pdn->full_name); 1140 pr_debug(" parent is %s\n", pdn->full_name);
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 7a3be6f6737a..7bbdc26d9512 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -580,7 +580,7 @@ static unsigned int __init build_one_device_irq(struct platform_device *op,
580 printk("%s: Apply [%s:%x] imap --> [%s:%x]\n", 580 printk("%s: Apply [%s:%x] imap --> [%s:%x]\n",
581 op->dev.of_node->full_name, 581 op->dev.of_node->full_name,
582 pp->full_name, this_orig_irq, 582 pp->full_name, this_orig_irq,
583 (iret ? iret->full_name : "NULL"), irq); 583 of_node_full_name(iret), irq);
584 584
585 if (!iret) 585 if (!iret)
586 break; 586 break;
diff --git a/drivers/of/base.c b/drivers/of/base.c
index a14f109dcd13..c181b94abc36 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -173,9 +173,9 @@ struct property *of_find_property(const struct device_node *np,
173 return NULL; 173 return NULL;
174 174
175 read_lock(&devtree_lock); 175 read_lock(&devtree_lock);
176 for (pp = np->properties; pp != 0; pp = pp->next) { 176 for (pp = np->properties; pp; pp = pp->next) {
177 if (of_prop_cmp(pp->name, name) == 0) { 177 if (of_prop_cmp(pp->name, name) == 0) {
178 if (lenp != 0) 178 if (lenp)
179 *lenp = pp->length; 179 *lenp = pp->length;
180 break; 180 break;
181 } 181 }
@@ -497,7 +497,7 @@ struct device_node *of_find_node_with_property(struct device_node *from,
497 read_lock(&devtree_lock); 497 read_lock(&devtree_lock);
498 np = from ? from->allnext : allnodes; 498 np = from ? from->allnext : allnodes;
499 for (; np; np = np->allnext) { 499 for (; np; np = np->allnext) {
500 for (pp = np->properties; pp != 0; pp = pp->next) { 500 for (pp = np->properties; pp; pp = pp->next) {
501 if (of_prop_cmp(pp->name, prop_name) == 0) { 501 if (of_prop_cmp(pp->name, prop_name) == 0) {
502 of_node_get(np); 502 of_node_get(np);
503 goto out; 503 goto out;
@@ -902,7 +902,7 @@ int of_parse_phandle_with_args(struct device_node *np, const char *list_name,
902 /* Retrieve the phandle list property */ 902 /* Retrieve the phandle list property */
903 list = of_get_property(np, list_name, &size); 903 list = of_get_property(np, list_name, &size);
904 if (!list) 904 if (!list)
905 return -EINVAL; 905 return -ENOENT;
906 list_end = list + size / sizeof(*list); 906 list_end = list + size / sizeof(*list);
907 907
908 /* Loop over the phandles until all the requested entry is found */ 908 /* 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,
1180 ap->stem[stem_len] = 0; 1180 ap->stem[stem_len] = 0;
1181 list_add_tail(&ap->link, &aliases_lookup); 1181 list_add_tail(&ap->link, &aliases_lookup);
1182 pr_debug("adding DT alias:%s: stem=%s id=%i node=%s\n", 1182 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));
1184} 1184}
1185 1185
1186/** 1186/**
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 9cf00602f566..ff8ab7b27373 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -255,7 +255,7 @@ int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
255 255
256 skiplevel: 256 skiplevel:
257 /* Iterate again with new parent */ 257 /* Iterate again with new parent */
258 pr_debug(" -> new parent: %s\n", newpar ? newpar->full_name : "<>"); 258 pr_debug(" -> new parent: %s\n", of_node_full_name(newpar));
259 of_node_put(ipar); 259 of_node_put(ipar);
260 ipar = newpar; 260 ipar = newpar;
261 newpar = NULL; 261 newpar = NULL;
diff --git a/drivers/of/of_mtd.c b/drivers/of/of_mtd.c
index e7cad627a5d1..a27ec94877e4 100644
--- a/drivers/of/of_mtd.c
+++ b/drivers/of/of_mtd.c
@@ -32,7 +32,7 @@ static const char *nand_ecc_modes[] = {
32 * The function gets ecc mode string from property 'nand-ecc-mode', 32 * The function gets ecc mode string from property 'nand-ecc-mode',
33 * and return its index in nand_ecc_modes table, or errno in error case. 33 * and return its index in nand_ecc_modes table, or errno in error case.
34 */ 34 */
35const int of_get_nand_ecc_mode(struct device_node *np) 35int of_get_nand_ecc_mode(struct device_node *np)
36{ 36{
37 const char *pm; 37 const char *pm;
38 int err, i; 38 int err, i;
diff --git a/include/linux/of.h b/include/linux/of.h
index b27c87191df2..0e9cf9eec085 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -163,6 +163,11 @@ static inline int of_node_to_nid(struct device_node *np) { return -1; }
163#define of_node_to_nid of_node_to_nid 163#define of_node_to_nid of_node_to_nid
164#endif 164#endif
165 165
166static inline const char* of_node_full_name(struct device_node *np)
167{
168 return np ? np->full_name : "<no-node>";
169}
170
166extern struct device_node *of_find_node_by_name(struct device_node *from, 171extern struct device_node *of_find_node_by_name(struct device_node *from,
167 const char *name); 172 const char *name);
168#define for_each_node_by_name(dn, name) \ 173#define for_each_node_by_name(dn, name) \
@@ -302,6 +307,11 @@ const char *of_prop_next_string(struct property *prop, const char *cur);
302 307
303#else /* CONFIG_OF */ 308#else /* CONFIG_OF */
304 309
310static inline const char* of_node_full_name(struct device_node *np)
311{
312 return "<no-node>";
313}
314
305static inline bool of_have_populated_dt(void) 315static inline bool of_have_populated_dt(void)
306{ 316{
307 return false; 317 return false;
diff --git a/include/linux/of_mtd.h b/include/linux/of_mtd.h
index bae1b6094c63..ed7f267e6389 100644
--- a/include/linux/of_mtd.h
+++ b/include/linux/of_mtd.h
@@ -11,7 +11,7 @@
11 11
12#ifdef CONFIG_OF_MTD 12#ifdef CONFIG_OF_MTD
13#include <linux/of.h> 13#include <linux/of.h>
14extern const int of_get_nand_ecc_mode(struct device_node *np); 14int of_get_nand_ecc_mode(struct device_node *np);
15int of_get_nand_bus_width(struct device_node *np); 15int of_get_nand_bus_width(struct device_node *np);
16bool of_get_nand_on_flash_bbt(struct device_node *np); 16bool of_get_nand_on_flash_bbt(struct device_node *np);
17#endif 17#endif
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 41c1564103f1..38c5eb839c92 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -448,7 +448,7 @@ unsigned int irq_create_mapping(struct irq_domain *domain,
448 } 448 }
449 449
450 pr_debug("irq %lu on domain %s mapped to virtual irq %u\n", 450 pr_debug("irq %lu on domain %s mapped to virtual irq %u\n",
451 hwirq, domain->of_node ? domain->of_node->full_name : "null", virq); 451 hwirq, of_node_full_name(domain->of_node), virq);
452 452
453 return virq; 453 return virq;
454} 454}
@@ -477,7 +477,7 @@ unsigned int irq_create_of_mapping(struct device_node *controller,
477 return intspec[0]; 477 return intspec[0];
478#endif 478#endif
479 pr_warning("no irq domain found for %s !\n", 479 pr_warning("no irq domain found for %s !\n",
480 controller->full_name); 480 of_node_full_name(controller));
481 return 0; 481 return 0;
482 } 482 }
483 483
@@ -725,8 +725,8 @@ static int virq_debug_show(struct seq_file *m, void *private)
725 data = irq_desc_get_chip_data(desc); 725 data = irq_desc_get_chip_data(desc);
726 seq_printf(m, data ? "0x%p " : " %p ", data); 726 seq_printf(m, data ? "0x%p " : " %p ", data);
727 727
728 if (desc->irq_data.domain && desc->irq_data.domain->of_node) 728 if (desc->irq_data.domain)
729 p = desc->irq_data.domain->of_node->full_name; 729 p = of_node_full_name(desc->irq_data.domain->of_node);
730 else 730 else
731 p = none; 731 p = none;
732 seq_printf(m, "%s\n", p); 732 seq_printf(m, "%s\n", p);