Skip to contentSkip to conversation

powerpc: pmac_feature_call checks platform

PATCH New Benjamin Herrenschmidt 1 participant 1 message Nov 1, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: pmac_feature_call checks platform

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.

include/asm-powerpc/pmac_feature.h +1 -1
Index: linux-work/include/asm-powerpc/pmac_feature.h
===================================================================
@@ -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);
 }