[POWERPC] pcibus_to_node fixes
[pandora-kernel.git] / include / asm-powerpc / topology.h
index b7abd42..f4c759b 100644 (file)
@@ -32,13 +32,13 @@ static inline int node_to_first_cpu(int node)
 
 int of_node_to_nid(struct device_node *device);
 
-#ifdef CONFIG_PPC64
-#define pcibus_to_node(bus)    (of_node_to_nid(bus->sysdata))
-#define pcibus_to_cpumask(bus) (node_to_cpumask(of_node_to_nid(bus->sysdata)))
-#else
-#define pcibus_to_node(node)    (-1)
-#define pcibus_to_cpumask(bus) (cpu_online_map)
-#endif
+struct pci_bus;
+extern int pcibus_to_node(struct pci_bus *bus);
+
+#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
+                                       CPU_MASK_ALL : \
+                                       node_to_cpumask(pcibus_to_node(bus)) \
+                               )
 
 /* sched_domains SD_NODE_INIT for PPC64 machines */
 #define SD_NODE_INIT (struct sched_domain) {           \