From c819acf447205b1040d21606271899e19f9ade05 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 22 May 2014 17:30:22 +0200 Subject: 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 (cherry picked from commit 18ae7362e9822993436c1a544e49cfd58fa175b2) --- include/linux/of.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') 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, 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_max_index(const char *stem); extern int of_machine_is_compatible(const char *compat); @@ -503,6 +504,11 @@ static inline int of_alias_get_id(struct device_node *np, 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; -- cgit v1.2.3