aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/cpu.c')
-rw-r--r--drivers/base/cpu.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 51f5d7fe2f0b..f48370dfc908 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -44,13 +44,11 @@ static int __ref cpu_subsys_online(struct device *dev)
44 struct cpu *cpu = container_of(dev, struct cpu, dev); 44 struct cpu *cpu = container_of(dev, struct cpu, dev);
45 int cpuid = dev->id; 45 int cpuid = dev->id;
46 int from_nid, to_nid; 46 int from_nid, to_nid;
47 int ret = -ENODEV; 47 int ret;
48
49 cpu_hotplug_driver_lock();
50 48
51 from_nid = cpu_to_node(cpuid); 49 from_nid = cpu_to_node(cpuid);
52 if (from_nid == NUMA_NO_NODE) 50 if (from_nid == NUMA_NO_NODE)
53 goto out; 51 return -ENODEV;
54 52
55 ret = cpu_up(cpuid); 53 ret = cpu_up(cpuid);
56 /* 54 /*
@@ -61,19 +59,12 @@ static int __ref cpu_subsys_online(struct device *dev)
61 if (from_nid != to_nid) 59 if (from_nid != to_nid)
62 change_cpu_under_node(cpu, from_nid, to_nid); 60 change_cpu_under_node(cpu, from_nid, to_nid);
63 61
64 out:
65 cpu_hotplug_driver_unlock();
66 return ret; 62 return ret;
67} 63}
68 64
69static int cpu_subsys_offline(struct device *dev) 65static int cpu_subsys_offline(struct device *dev)
70{ 66{
71 int ret; 67 return cpu_down(dev->id);
72
73 cpu_hotplug_driver_lock();
74 ret = cpu_down(dev->id);
75 cpu_hotplug_driver_unlock();
76 return ret;
77} 68}
78 69
79void unregister_cpu(struct cpu *cpu) 70void unregister_cpu(struct cpu *cpu)