From: Mikael Pettersson <mikpe@user.it.uu.se>

In ppc32 kernels configured without Open Firmware support (typical for
embedded systems), perfctr causes a linkage error due to unconditional
references to OF querying functions.

This patch fixes that by stubbing out the offending code when OF is absent.
 There are already fallbacks in place in case OF fails, so things (core
frequency detection) still work, at least for supported CPU types.

Fixes a problem originally reported for perfctr-2.6.x by Jean-Christophe
Dubois.

Signed-off-by: Mikael Pettersson <mikpe@csd.uu.se>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/perfctr/ppc.c |    4 ++++
 1 files changed, 4 insertions(+)

diff -puN drivers/perfctr/ppc.c~perfctr-handle-non-of-ppc32-platforms drivers/perfctr/ppc.c
--- 25/drivers/perfctr/ppc.c~perfctr-handle-non-of-ppc32-platforms	Fri Jun 24 15:37:02 2005
+++ 25-akpm/drivers/perfctr/ppc.c	Fri Jun 24 15:37:02 2005
@@ -888,6 +888,7 @@ static unsigned int __init pll_to_core_k
 
 /* Extract core and timebase frequencies from Open Firmware. */
 
+#ifdef CONFIG_PPC_OF
 static unsigned int __init of_to_core_khz(void)
 {
 	struct device_node *cpu;
@@ -905,6 +906,9 @@ static unsigned int __init of_to_core_kh
 	perfctr_info.tsc_to_cpu_mult = core / tb;
 	return core / 1000;
 }
+#else
+static inline unsigned int of_to_core_khz(void) { return 0; }
+#endif
 
 static unsigned int __init detect_cpu_khz(enum pll_type pll_type)
 {
_