aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/prom.h7
-rw-r--r--arch/sparc/include/asm/prom.h4
-rw-r--r--drivers/of/base.c7
-rw-r--r--include/linux/of.h11
4 files changed, 11 insertions, 18 deletions
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
index bd215f74df0f..6707c16d8fc5 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -42,13 +42,6 @@ extern void kdump_move_device_tree(void);
42/* cache lookup */ 42/* cache lookup */
43struct device_node *of_find_next_cache_node(struct device_node *np); 43struct device_node *of_find_next_cache_node(struct device_node *np);
44 44
45#ifdef CONFIG_NUMA
46extern int of_node_to_nid(struct device_node *device);
47#else
48static inline int of_node_to_nid(struct device_node *device) { return 0; }
49#endif
50#define of_node_to_nid of_node_to_nid
51
52extern void of_instantiate_rtc(void); 45extern void of_instantiate_rtc(void);
53 46
54extern int of_get_ibm_chip_id(struct device_node *np); 47extern int of_get_ibm_chip_id(struct device_node *np);
diff --git a/arch/sparc/include/asm/prom.h b/arch/sparc/include/asm/prom.h
index 67c62578d170..60c8d7bd4058 100644
--- a/arch/sparc/include/asm/prom.h
+++ b/arch/sparc/include/asm/prom.h
@@ -43,10 +43,6 @@ extern int of_getintprop_default(struct device_node *np,
43 const char *name, 43 const char *name,
44 int def); 44 int def);
45extern int of_find_in_proplist(const char *list, const char *match, int len); 45extern int of_find_in_proplist(const char *list, const char *match, int len);
46#ifdef CONFIG_NUMA
47extern int of_node_to_nid(struct device_node *dp);
48#define of_node_to_nid of_node_to_nid
49#endif
50 46
51extern void prom_build_devicetree(void); 47extern void prom_build_devicetree(void);
52extern void of_populate_present_mask(void); 48extern void of_populate_present_mask(void);
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 865d3f66c86b..ced4c06d79b3 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -74,6 +74,13 @@ int of_n_size_cells(struct device_node *np)
74} 74}
75EXPORT_SYMBOL(of_n_size_cells); 75EXPORT_SYMBOL(of_n_size_cells);
76 76
77#ifdef CONFIG_NUMA
78int __weak of_node_to_nid(struct device_node *np)
79{
80 return numa_node_id();
81}
82#endif
83
77#if defined(CONFIG_OF_DYNAMIC) 84#if defined(CONFIG_OF_DYNAMIC)
78/** 85/**
79 * of_node_get - Increment refcount of a node 86 * of_node_get - Increment refcount of a node
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,
534#define of_match_node(_matches, _node) NULL 534#define of_match_node(_matches, _node) NULL
535#endif /* CONFIG_OF */ 535#endif /* CONFIG_OF */
536 536
537#ifndef of_node_to_nid 537#if defined(CONFIG_OF) && defined(CONFIG_NUMA)
538static inline int of_node_to_nid(struct device_node *np) 538extern int of_node_to_nid(struct device_node *np);
539{ 539#else
540 return numa_node_id(); 540static inline int of_node_to_nid(struct device_node *device) { return 0; }
541}
542
543#define of_node_to_nid of_node_to_nid
544#endif 541#endif
545 542
546/** 543/**