diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-05-22 11:30:22 -0400 |
---|---|---|
committer | Dong Aisheng <b29396@freescale.com> | 2014-06-24 02:11:52 -0400 |
commit | c819acf447205b1040d21606271899e19f9ade05 (patch) | |
tree | 2b9b51ea327479defaec1c6c1887bdc18f26b4dc /include | |
parent | 9f82045316a36af3a4ea9a666f367de416a2237a (diff) |
of: Add helper for getting the maximum alias index for a stem
of_alias_max_index will return the maximum number for which an
alias of a given stem exists. This is useful for frameworks
whishing to reserve a number of device slots from dynamic
allocation.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
(cherry picked from commit 18ae7362e9822993436c1a544e49cfd58fa175b2)
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/of.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index 668e12322dd4..7a07fa495bc7 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -286,6 +286,7 @@ extern int of_count_phandle_with_args(const struct device_node *np, | |||
286 | 286 | ||
287 | extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)); | 287 | extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)); |
288 | extern int of_alias_get_id(struct device_node *np, const char *stem); | 288 | extern int of_alias_get_id(struct device_node *np, const char *stem); |
289 | extern int of_alias_max_index(const char *stem); | ||
289 | 290 | ||
290 | extern int of_machine_is_compatible(const char *compat); | 291 | extern int of_machine_is_compatible(const char *compat); |
291 | 292 | ||
@@ -503,6 +504,11 @@ static inline int of_alias_get_id(struct device_node *np, const char *stem) | |||
503 | return -ENOSYS; | 504 | return -ENOSYS; |
504 | } | 505 | } |
505 | 506 | ||
507 | static inline int of_alias_max_index(const char *stem) | ||
508 | { | ||
509 | return -ENODEV; | ||
510 | } | ||
511 | |||
506 | static inline int of_machine_is_compatible(const char *compat) | 512 | static inline int of_machine_is_compatible(const char *compat) |
507 | { | 513 | { |
508 | return 0; | 514 | return 0; |