summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-05-22 17:30:22 +0200
committerDong Aisheng <b29396@freescale.com>2014-06-24 14:11:52 +0800
commitc819acf447205b1040d21606271899e19f9ade05 (patch)
tree2b9b51ea327479defaec1c6c1887bdc18f26b4dc /include
parent9f82045316a36af3a4ea9a666f367de416a2237a (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.h6
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,
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;