diff options
author | Steffen Trumtrar <s.trumtrar@pengutronix.de> | 2012-11-22 06:16:43 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-11-29 12:27:19 -0500 |
commit | b8fbdc42c5c5df8ab1f358fe90e3a8a1bdc9ae48 (patch) | |
tree | 93e441ba5066c1c4593a127d39625122099f242a | |
parent | 4a92a385f867b26297b736e9b9cc42bd6dbf0f2b (diff) |
of: add 'const' for of_parse_phandle parameter *np
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>
-rw-r--r-- | drivers/of/base.c | 4 | ||||
-rw-r--r-- | include/linux/of.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index 0ceb26a16050..c3724110a288 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
@@ -978,8 +978,8 @@ EXPORT_SYMBOL_GPL(of_property_count_strings); | |||
978 | * Returns the device_node pointer with refcount incremented. Use | 978 | * Returns the device_node pointer with refcount incremented. Use |
979 | * of_node_put() on it when done. | 979 | * of_node_put() on it when done. |
980 | */ | 980 | */ |
981 | struct device_node * | 981 | struct device_node *of_parse_phandle(const struct device_node *np, |
982 | of_parse_phandle(struct device_node *np, const char *phandle_name, int index) | 982 | const char *phandle_name, int index) |
983 | { | 983 | { |
984 | const __be32 *phandle; | 984 | const __be32 *phandle; |
985 | int size; | 985 | int size; |
diff --git a/include/linux/of.h b/include/linux/of.h index 13e0aacb4d9f..7337dc109c89 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -270,7 +270,7 @@ extern int of_n_size_cells(struct device_node *np); | |||
270 | extern const struct of_device_id *of_match_node( | 270 | extern const struct of_device_id *of_match_node( |
271 | const struct of_device_id *matches, const struct device_node *node); | 271 | const struct of_device_id *matches, const struct device_node *node); |
272 | extern int of_modalias_node(struct device_node *node, char *modalias, int len); | 272 | extern int of_modalias_node(struct device_node *node, char *modalias, int len); |
273 | extern struct device_node *of_parse_phandle(struct device_node *np, | 273 | extern struct device_node *of_parse_phandle(const struct device_node *np, |
274 | const char *phandle_name, | 274 | const char *phandle_name, |
275 | int index); | 275 | int index); |
276 | extern int of_parse_phandle_with_args(struct device_node *np, | 276 | 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, | |||
438 | return -ENOSYS; | 438 | return -ENOSYS; |
439 | } | 439 | } |
440 | 440 | ||
441 | static inline struct device_node *of_parse_phandle(struct device_node *np, | 441 | static inline struct device_node *of_parse_phandle(const struct device_node *np, |
442 | const char *phandle_name, | 442 | const char *phandle_name, |
443 | int index) | 443 | int index) |
444 | { | 444 | { |