summaryrefslogtreecommitdiffstats
path: root/include/linux/of.h
diff options
context:
space:
mode:
authorRob Herring2013-09-17 17:42:50 +0200
committerRob Herring2013-10-10 03:04:07 +0200
commit0c3f061c195ceb891067b6de9e4ecc347c4dea31 (patch)
treea576f97862dc34377dd55734bff47da6bb7603c7 /include/linux/of.h
parentof: implement pci_address_to_pio as weak function (diff)
downloadkernel-qcow2-linux-0c3f061c195ceb891067b6de9e4ecc347c4dea31.tar.gz
kernel-qcow2-linux-0c3f061c195ceb891067b6de9e4ecc347c4dea31.tar.xz
kernel-qcow2-linux-0c3f061c195ceb891067b6de9e4ecc347c4dea31.zip
of: implement of_node_to_nid as a weak function
Implement of_node_to_nid as weak function to remove the dependency on asm/prom.h. This is in preparation to make prom.h optional. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'include/linux/of.h')
-rw-r--r--include/linux/of.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index f95aee391e30..4d294a0b8a57 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -534,13 +534,10 @@ static inline const char *of_prop_next_string(struct property *prop,
#define of_match_node(_matches, _node) NULL
#endif /* CONFIG_OF */
-#ifndef of_node_to_nid
-static inline int of_node_to_nid(struct device_node *np)
-{
- return numa_node_id();
-}
-
-#define of_node_to_nid of_node_to_nid
+#if defined(CONFIG_OF) && defined(CONFIG_NUMA)
+extern int of_node_to_nid(struct device_node *np);
+#else
+static inline int of_node_to_nid(struct device_node *device) { return 0; }
#endif
/**