Merge tag 'cpu-hotplug-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[firefly-linux-kernel-4.4.55.git] / drivers / base / topology.c
index ad9d177626640377de6e517fe6d62db093039166..bbcbd3c4392689ef5022af42d0a09bb504be7253 100644 (file)
@@ -160,16 +160,20 @@ static int topology_cpu_callback(struct notifier_block *nfb,
 static int topology_sysfs_init(void)
 {
        int cpu;
-       int rc;
+       int rc = 0;
+
+       cpu_notifier_register_begin();
 
        for_each_online_cpu(cpu) {
                rc = topology_add_dev(cpu);
                if (rc)
-                       return rc;
+                       goto out;
        }
-       hotcpu_notifier(topology_cpu_callback, 0);
+       __hotcpu_notifier(topology_cpu_callback, 0);
 
-       return 0;
+out:
+       cpu_notifier_register_done();
+       return rc;
 }
 
 device_initcall(topology_sysfs_init);