]> git.karo-electronics.de Git - linux-beck.git/commitdiff
of: add 'const' for of_parse_phandle parameter *np
authorSteffen Trumtrar <s.trumtrar@pengutronix.de>
Thu, 22 Nov 2012 11:16:43 +0000 (12:16 +0100)
committerGrant Likely <grant.likely@secretlab.ca>
Thu, 29 Nov 2012 17:27:19 +0000 (17:27 +0000)
The existing function does not change the passed device_node pointer. It is
only handed to of_get_property which itself takes a const struct device_node.

of_parse_phandle() can therefore take a const pointer as well.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
[grant.likely: drop extraneous whitespace change]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/of/base.c
include/linux/of.h

index 0ceb26a160508a30277130585fe846e5822750fa..c3724110a2888179512074da056a048c5b71db7b 100644 (file)
@@ -978,8 +978,8 @@ EXPORT_SYMBOL_GPL(of_property_count_strings);
  * Returns the device_node pointer with refcount incremented.  Use
  * of_node_put() on it when done.
  */
-struct device_node *
-of_parse_phandle(struct device_node *np, const char *phandle_name, int index)
+struct device_node *of_parse_phandle(const struct device_node *np,
+                                    const char *phandle_name, int index)
 {
        const __be32 *phandle;
        int size;
index 13e0aacb4d9f68e6ffb73175a6cd5de36a0c32a1..7337dc109c8972cf30e9e0529d4240d10bebbd7f 100644 (file)
@@ -270,7 +270,7 @@ extern int of_n_size_cells(struct device_node *np);
 extern const struct of_device_id *of_match_node(
        const struct of_device_id *matches, const struct device_node *node);
 extern int of_modalias_node(struct device_node *node, char *modalias, int len);
-extern struct device_node *of_parse_phandle(struct device_node *np,
+extern struct device_node *of_parse_phandle(const struct device_node *np,
                                            const char *phandle_name,
                                            int index);
 extern int of_parse_phandle_with_args(struct device_node *np,
@@ -438,7 +438,7 @@ static inline int of_property_match_string(struct device_node *np,
        return -ENOSYS;
 }
 
-static inline struct device_node *of_parse_phandle(struct device_node *np,
+static inline struct device_node *of_parse_phandle(const struct device_node *np,
                                                   const char *phandle_name,
                                                   int index)
 {