Merge tag 'dt-for-3.7' of git://sources.calxeda.com/kernel/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Oct 2012 16:44:08 +0000 (09:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Oct 2012 16:44:08 +0000 (09:44 -0700)
Pull devicetree updates from Rob Herring:
 - Import of latest upstream device tree compiler (dtc)
 - New function of_get_child_by_name
 - Support for #size-cells of 0 and #addr-cells of >2
 - Couple of DT binding documentation updates

Fix up trivial conflicts due to of_get_child_by_name() having been added
next to the new of_get_next_available_child().

* tag 'dt-for-3.7' of git://sources.calxeda.com/kernel/linux:
  MAINTAINERS: add scripts/dtc under Devicetree maintainers
  dtc: import latest upstream dtc
  dt: Document general interrupt controller bindings
  dt/s3c64xx/spi: Use of_get_child_by_name to get a named child
  dt: introduce of_get_child_by_name to get child node by name
  of: i2c: add support for wakeup-source property
  of/address: Handle #address-cells > 2 specially
  DT: export of_irq_to_resource_table()
  devicetree: serial: Add documentation for imx serial
  devicetree: pwm: mxs-pwm.txt: Fix reg field annotation
  of: Allow busses with #size-cells=0

1  2 
MAINTAINERS
drivers/of/base.c
drivers/spi/spi-s3c64xx.c
include/linux/of.h

diff --cc MAINTAINERS
Simple merge
index d4a1c9a043e12d3572faefe9a9fd11a1683cdd97,e2e813624df5980d0f3995cffd3b356e839058ca..af3b22ac762755b532286ac505fb85ef936ca64b
@@@ -363,33 -363,29 +363,56 @@@ struct device_node *of_get_next_child(c
  }
  EXPORT_SYMBOL(of_get_next_child);
  
 +/**
 + *    of_get_next_available_child - Find the next available child node
 + *    @node:  parent node
 + *    @prev:  previous child of the parent node, or NULL to get first
 + *
 + *      This function is like of_get_next_child(), except that it
 + *      automatically skips any disabled nodes (i.e. status = "disabled").
 + */
 +struct device_node *of_get_next_available_child(const struct device_node *node,
 +      struct device_node *prev)
 +{
 +      struct device_node *next;
 +
 +      read_lock(&devtree_lock);
 +      next = prev ? prev->sibling : node->child;
 +      for (; next; next = next->sibling) {
 +              if (!of_device_is_available(next))
 +                      continue;
 +              if (of_node_get(next))
 +                      break;
 +      }
 +      of_node_put(prev);
 +      read_unlock(&devtree_lock);
 +      return next;
 +}
 +EXPORT_SYMBOL(of_get_next_available_child);
 +
+ /**
+  *    of_get_child_by_name - Find the child node by name for a given parent
+  *    @node:  parent node
+  *    @name:  child name to look for.
+  *
+  *      This function looks for child node for given matching name
+  *
+  *    Returns a node pointer if found, with refcount incremented, use
+  *    of_node_put() on it when done.
+  *    Returns NULL if node is not found.
+  */
+ struct device_node *of_get_child_by_name(const struct device_node *node,
+                               const char *name)
+ {
+       struct device_node *child;
+       for_each_child_of_node(node, child)
+               if (child->name && (of_node_cmp(child->name, name) == 0))
+                       break;
+       return child;
+ }
+ EXPORT_SYMBOL(of_get_child_by_name);
  /**
   *    of_find_node_by_path - Find a node matching a full OF path
   *    @path:  The full path to match
Simple merge
index 1b1163225f3b8ab1eafacbb21e83ab8f86d50d42,fabb524d3d755e029536c518a447b9a5dd979753..f594c528842fece04fc6931d627f0b34bf6ca931
@@@ -190,9 -190,8 +190,11 @@@ extern struct device_node *of_get_paren
  extern struct device_node *of_get_next_parent(struct device_node *node);
  extern struct device_node *of_get_next_child(const struct device_node *node,
                                             struct device_node *prev);
 +extern struct device_node *of_get_next_available_child(
 +      const struct device_node *node, struct device_node *prev);
 +
+ extern struct device_node *of_get_child_by_name(const struct device_node *node,
+                                       const char *name);
  #define for_each_child_of_node(parent, child) \
        for (child = of_get_next_child(parent, NULL); child != NULL; \
             child = of_get_next_child(parent, child))