diff options
| author | 2017-01-26 16:56:31 +0100 | |
|---|---|---|
| committer | 2017-01-26 16:56:31 +0100 | |
| commit | a41dfe799a22a5da7e59ac5743be3d5338b6d373 (patch) | |
| tree | f2db91257d9ec58b6074ae69ec1bcf80e151314d /kernel | |
| parent | pinctrl: baytrail: Fix debugfs offset output (diff) | |
| parent | Linux 4.10-rc2 (diff) | |
Merge tag 'v4.10-rc2' into devel
Linux 4.10-rc2
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/cpu.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 042fd7e8e030..f75c4d031eeb 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1471,6 +1471,7 @@ int __cpuhp_setup_state(enum cpuhp_state state, bool multi_instance) { int cpu, ret = 0; + bool dynstate; if (cpuhp_cb_check(state) || !name) return -EINVAL; @@ -1480,6 +1481,12 @@ int __cpuhp_setup_state(enum cpuhp_state state, ret = cpuhp_store_callbacks(state, name, startup, teardown, multi_instance); + dynstate = state == CPUHP_AP_ONLINE_DYN; + if (ret > 0 && dynstate) { + state = ret; + ret = 0; + } + if (ret || !invoke || !startup) goto out; @@ -1508,7 +1515,7 @@ out: * If the requested state is CPUHP_AP_ONLINE_DYN, return the * dynamically allocated state in case of success. */ - if (!ret && state == CPUHP_AP_ONLINE_DYN) + if (!ret && dynstate) return state; return ret; } |
