[S390] topology: clean up facility detection
Move cpu topology facility detection to early setup code where it
should be.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index 91fb66b..6900441 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -66,7 +66,6 @@
static int topology_enabled = 1;
static void topology_work_fn(struct work_struct *work);
static struct tl_info *tl_info;
-static int machine_has_topology;
static struct timer_list topology_timer;
static void set_topology_timer(void);
static DECLARE_WORK(topology_work, topology_work_fn);
@@ -88,7 +87,7 @@
cpumask_t mask;
cpus_clear(mask);
- if (!topology_enabled || !machine_has_topology)
+ if (!topology_enabled || !MACHINE_HAS_TOPOLOGY)
return cpu_possible_map;
while (info) {
if (cpu_isset(cpu, info->mask)) {
@@ -186,7 +185,6 @@
break;
default:
clear_masks();
- machine_has_topology = 0;
goto out;
}
tle = next_tle(tle);
@@ -223,7 +221,7 @@
int cpu;
int rc;
- if (!machine_has_topology)
+ if (!MACHINE_HAS_TOPOLOGY)
return -EOPNOTSUPP;
if (fc)
rc = ptf(PTF_VERTICAL);
@@ -269,7 +267,7 @@
struct sys_device *sysdev;
int cpu;
- if (!machine_has_topology) {
+ if (!MACHINE_HAS_TOPOLOGY) {
update_cpu_core_map();
topology_update_polarization_simple();
return 0;
@@ -323,7 +321,7 @@
int rc;
rc = 0;
- if (!machine_has_topology) {
+ if (!MACHINE_HAS_TOPOLOGY) {
topology_update_polarization_simple();
goto out;
}
@@ -354,10 +352,8 @@
struct tl_info *info;
int i;
- if (!test_facility(2) || !test_facility(11))
+ if (!MACHINE_HAS_TOPOLOGY)
return;
- machine_has_topology = 1;
-
tl_info = alloc_bootmem_pages(PAGE_SIZE);
info = tl_info;
store_topology(info);