powerpc/pseries: Update numa.c to use updated firmware_has_feature()

Update the numa code to use the updated firmware_has_feature() when checking
for type 1 affinity.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
Nathan Fontenot 2013-04-24 05:58:23 +00:00 committed by Benjamin Herrenschmidt
parent f0ff7eb483
commit 8002b0c54b
1 changed files with 3 additions and 19 deletions

View File

@ -291,9 +291,7 @@ EXPORT_SYMBOL_GPL(of_node_to_nid);
static int __init find_min_common_depth(void) static int __init find_min_common_depth(void)
{ {
int depth; int depth;
struct device_node *chosen;
struct device_node *root; struct device_node *root;
const char *vec5;
if (firmware_has_feature(FW_FEATURE_OPAL)) if (firmware_has_feature(FW_FEATURE_OPAL))
root = of_find_node_by_path("/ibm,opal"); root = of_find_node_by_path("/ibm,opal");
@ -325,26 +323,12 @@ static int __init find_min_common_depth(void)
distance_ref_points_depth /= sizeof(int); distance_ref_points_depth /= sizeof(int);
#define VEC5_AFFINITY_BYTE 5 if (firmware_has_feature(FW_FEATURE_OPAL) ||
#define VEC5_AFFINITY 0x80 firmware_has_feature(FW_FEATURE_TYPE1_AFFINITY)) {
if (firmware_has_feature(FW_FEATURE_OPAL))
form1_affinity = 1;
else {
chosen = of_find_node_by_path("/chosen");
if (chosen) {
vec5 = of_get_property(chosen,
"ibm,architecture-vec-5", NULL);
if (vec5 && (vec5[VEC5_AFFINITY_BYTE] &
VEC5_AFFINITY)) {
dbg("Using form 1 affinity\n"); dbg("Using form 1 affinity\n");
form1_affinity = 1; form1_affinity = 1;
} }
of_node_put(chosen);
}
}
if (form1_affinity) { if (form1_affinity) {
depth = distance_ref_points[0]; depth = distance_ref_points[0];
} else { } else {