diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-02-10 06:45:55 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-02-10 06:45:55 -0800 |
| commit | c8fbebb199db64d7fb7deee09988cbfb7c781146 (patch) | |
| tree | 45040d67afeb2aa0fc703b679d9295e24a56cdcb | |
| parent | d01d82d61623b23f85d14da5ea711301c4940a10 (diff) | |
| parent | df795ecb7ce34797e157b24735f24d8d38281d76 (diff) | |
Merge "driver-core: cpu: Make isolate node read-only"
| -rw-r--r-- | drivers/base/cpu.c | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 118a4f245ad1..8882f0bc94a5 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -182,8 +182,8 @@ static struct attribute_group crash_note_cpu_attr_group = { #ifdef CONFIG_HOTPLUG_CPU -static ssize_t show_cpu_isolated(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t isolate_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct cpu *cpu = container_of(dev, struct cpu, dev); ssize_t rc; @@ -195,31 +195,7 @@ static ssize_t show_cpu_isolated(struct device *dev, return rc; } -static ssize_t __ref store_cpu_isolated(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct cpu *cpu = container_of(dev, struct cpu, dev); - int err; - int cpuid = cpu->dev.id; - unsigned int isolated; - - err = kstrtouint(strstrip((char *)buf), 0, &isolated); - if (err) - return err; - - if (isolated > 1) - return -EINVAL; - - if (isolated) - sched_isolate_cpu(cpuid); - else - sched_unisolate_cpu(cpuid); - - return count; -} - -static DEVICE_ATTR(isolate, 0644, show_cpu_isolated, store_cpu_isolated); +static DEVICE_ATTR_RO(isolate); static struct attribute *cpu_isolated_attrs[] = { &dev_attr_isolate.attr, |
