[PATCH] powerpc: pmac_feature_call checks platform
Benjamin Herrenschmidt
benh at kernel.crashing.org
Wed Nov 1 15:53:00 EST 2006
This patch makes sure that a caller of pmac_call_feature() won't try to call
into ppc_md.feature_call of another platform which might happen if some
powermac drivers are loaded on powermac machines.
Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
Index: linux-work/include/asm-powerpc/pmac_feature.h
===================================================================
--- linux-work.orig/include/asm-powerpc/pmac_feature.h 2006-09-08 17:17:52.000000000 +1000
+++ linux-work/include/asm-powerpc/pmac_feature.h 2006-11-01 14:34:13.000000000 +1100
@@ -146,7 +146,7 @@ struct device_node;
static inline long pmac_call_feature(int selector, struct device_node* node,
long param, long value)
{
- if (!ppc_md.feature_call)
+ if (!ppc_md.feature_call || !machine_is(powermac))
return -ENODEV;
return ppc_md.feature_call(selector, node, param, value);
}
More information about the Linuxppc-dev
mailing list