[POWERPC] pmac_feature_call checks platform
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 1 Nov 2006 04:53:00 +0000 (15:53 +1100)
committerPaul Mackerras <paulus@samba.org>
Wed, 2 May 2007 06:35:01 +0000 (16:35 +1000)
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 non-powermac machines.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
include/asm-powerpc/pmac_feature.h

index d3599cc9aa7486464ca914f7cacaa0adf3c06c65..d43d91beba9b3ed2af3a04e8d549bca5731fa8c0 100644 (file)
@@ -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);
 }