diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-05-22 17:30:22 +0200 |
---|---|---|
committer | Nitin Garg <nitin.garg@nxp.com> | 2016-01-14 11:01:45 -0600 |
commit | f5a95f6da77f624f714f1d2d56fe1c5768c52709 (patch) | |
tree | b178edfef8a3a25983f0c63b70057d5275f07750 /include | |
parent | 2a67a39a84183d33c5a9b9d01a16889c17f43833 (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 5ce2ad39b36fd48b9f77249198655da7cbcc7ee5)
Conflicts:
include/linux/of.h
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 8135d507d089..ccacc91841ab 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -336,6 +336,7 @@ extern int of_count_phandle_with_args(const struct device_node *np, extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)); extern int of_alias_get_id(struct device_node *np, const char *stem); extern int of_alias_get_highest_id(const char *stem); +extern int of_alias_max_index(const char *stem); extern int of_machine_is_compatible(const char *compat); @@ -612,6 +613,11 @@ static inline int of_alias_get_highest_id(const char *stem) return -ENOSYS; } +static inline int of_alias_max_index(const char *stem) +{ + return -ENODEV; +} + static inline int of_machine_is_compatible(const char *compat) { return 0; |