diff options
| author | Russell King <rmk+kernel@armlinux.org.uk> | 2017-02-28 11:05:54 +0000 |
|---|---|---|
| committer | Russell King <rmk+kernel@armlinux.org.uk> | 2017-02-28 11:05:54 +0000 |
| commit | 399f157afd30ad942e08dfa0ab28734c50bc6b00 (patch) | |
| tree | a772e97b85d91ae5553707f597b4443a511c99ec /kernel/cpu.c | |
| parent | a09975bf6c756e4555a95258ff4b2286dcfddc4e (diff) | |
| parent | 1a08e3d9e0ac4577ba89dbdb38f593fe050f88fc (diff) | |
Merge branch 'devel-stable' into misc
Diffstat (limited to 'kernel/cpu.c')
| -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; } |
