Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck...
[linux-drm-fsl-dcu.git] / kernel / cpu.c
index 2227b58734a7e5c16cbedcdaad347cb236e4f57f..deff2e693766997a259b4b3ac2fc4f789e554f1d 100644 (file)
@@ -440,11 +440,6 @@ int cpu_up(unsigned int cpu)
 {
        int err = 0;
 
-#ifdef CONFIG_MEMORY_HOTPLUG
-       int nid;
-       pg_data_t       *pgdat;
-#endif
-
        if (!cpu_possible(cpu)) {
                printk(KERN_ERR "can't online cpu %d because it is not "
                        "configured as may-hotadd at boot time\n", cpu);
@@ -455,27 +450,9 @@ int cpu_up(unsigned int cpu)
                return -EINVAL;
        }
 
-#ifdef CONFIG_MEMORY_HOTPLUG
-       nid = cpu_to_node(cpu);
-       if (!node_online(nid)) {
-               err = mem_online_node(nid);
-               if (err)
-                       return err;
-       }
-
-       pgdat = NODE_DATA(nid);
-       if (!pgdat) {
-               printk(KERN_ERR
-                       "Can't online cpu %d due to NULL pgdat\n", cpu);
-               return -ENOMEM;
-       }
-
-       if (pgdat->node_zonelists->_zonerefs->zone == NULL) {
-               mutex_lock(&zonelists_mutex);
-               build_all_zonelists(NULL, NULL);
-               mutex_unlock(&zonelists_mutex);
-       }
-#endif
+       err = try_online_node(cpu_to_node(cpu));
+       if (err)
+               return err;
 
        cpu_maps_update_begin();