[PATCH 2.6.12-mm1] perfctr: handle non-OF ppc32 platforms

From: Mikael Pettersson
Date: Wed Jun 22 2005 - 04:47:21 EST

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@xxxxxxxxx>

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

diff -rupN linux-2.6.12-mm1/drivers/perfctr/ppc.c linux-2.6.12-mm1.perfctr-ppc32-no-of-fix/drivers/perfctr/ppc.c
--- linux-2.6.12-mm1/drivers/perfctr/ppc.c 2005-06-22 00:35:44.000000000 +0200
+++ linux-2.6.12-mm1.perfctr-ppc32-no-of-fix/drivers/perfctr/ppc.c 2005-06-22 01:32:09.000000000 +0200
@@ -888,6 +888,7 @@ static unsigned int __init pll_to_core_k

/* Extract core and timebase frequencies from Open Firmware. */

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;
+static inline unsigned int of_to_core_khz(void) { return 0; }

static unsigned int __init detect_cpu_khz(enum pll_type pll_type)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/