__blockdev_direct_IO(): get rid of submit_io callback
[sfrench/cifs-2.6.git] / include / linux / of.h
index 37afd04f36eb4d6f326f87af88b2360ae674d170..0af611307db2212d2db2f54cbabe30bb51787e1a 100644 (file)
@@ -100,6 +100,17 @@ struct of_reconfig_data {
        struct property         *old_prop;
 };
 
+/**
+ * of_node_init - initialize a devicetree node
+ * @node: Pointer to device node that has been created by kzalloc()
+ * @phandle_name: Name of property holding a phandle value
+ *
+ * On return the device_node refcount is set to one.  Use of_node_put()
+ * on @node when done to free the memory allocated for it.  If the node
+ * is NOT a dynamic node the memory will not be freed. The decision of
+ * whether to free the memory will be done by node->release(), which is
+ * of_node_release().
+ */
 /* initialize a node */
 extern const struct kobj_type of_node_ktype;
 extern const struct fwnode_operations of_fwnode_ops;
@@ -1008,6 +1019,31 @@ static inline int of_parse_phandle_with_fixed_args(const struct device_node *np,
                                            index, out_args);
 }
 
+/**
+ * of_parse_phandle_with_optional_args() - Find a node pointed by phandle in a list
+ * @np:                pointer to a device tree node containing a list
+ * @list_name: property name that contains a list
+ * @cells_name:        property name that specifies phandles' arguments count
+ * @index:     index of a phandle to parse out
+ * @out_args:  optional pointer to output arguments structure (will be filled)
+ *
+ * Same as of_parse_phandle_with_args() except that if the cells_name property
+ * is not found, cell_count of 0 is assumed.
+ *
+ * This is used to useful, if you have a phandle which didn't have arguments
+ * before and thus doesn't have a '#*-cells' property but is now migrated to
+ * having arguments while retaining backwards compatibility.
+ */
+static inline int of_parse_phandle_with_optional_args(const struct device_node *np,
+                                                     const char *list_name,
+                                                     const char *cells_name,
+                                                     int index,
+                                                     struct of_phandle_args *out_args)
+{
+       return __of_parse_phandle_with_args(np, list_name, cells_name,
+                                           0, index, out_args);
+}
+
 /**
  * of_property_count_u8_elems - Count the number of u8 elements in a property
  *