From ed5f886d16369fed5a69d96b8e85777c47206de1 Mon Sep 17 00:00:00 2001 From: Nicolas Ferre Date: Thu, 27 Oct 2011 11:07:28 +0200 Subject: dt: add empty of_alias_get_id() for non-dt builds Add function of_alias_get_id() reporting -ENOSYS for non-dt builds, so that drivers migrating to dt can save some '#ifdef CONFIG_OF'. Signed-off-by: Nicolas Ferre Acked-by: Rob Herring Signed-off-by: Grant Likely --- include/linux/of.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/linux') diff --git a/include/linux/of.h b/include/linux/of.h index 5dbe263462a9..758899d4902b 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -303,6 +303,11 @@ static inline struct device_node *of_parse_phandle(struct device_node *np, return NULL; } +static inline int of_alias_get_id(struct device_node *np, const char *stem) +{ + return -ENOSYS; +} + #define of_match_ptr(_ptr) NULL #define of_match_node(_matches, _node) NULL #endif /* CONFIG_OF */ -- cgit v1.2.3 From 50e07f888cb24b55e0d8283f631907794dd757c2 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Tue, 25 Oct 2011 14:01:26 +0200 Subject: dt: add empty of_machine_is_compatible The patch adds an empty function for non-dt build, so that drivers migrating to dt can save some '#ifdef CONFIG_OF'. v3: New patch Signed-off-by: Stephen Warren Signed-off-by: Grant Likely --- include/linux/of.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/linux') diff --git a/include/linux/of.h b/include/linux/of.h index 4386c5fee57c..0e89aa0bf07a 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -326,6 +326,11 @@ static inline int of_alias_get_id(struct device_node *np, const char *stem) return -ENOSYS; } +static inline int of_machine_is_compatible(const char *compat) +{ + return 0; +} + #define of_match_ptr(_ptr) NULL #define of_match_node(_matches, _node) NULL #endif /* CONFIG_OF */ -- cgit v1.2.3