ARM: cpuidle: Don't register the driver when back-end init returns -ENXIO
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 1 Nov 2018 12:22:38 +0000 (13:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Nov 2018 08:19:23 +0000 (09:19 +0100)
commit110e9082dc64e152b845d910276a60be617bf9ca
treec0280bfbc79443c07b0a74ad2ccca2edd1441c67
parent0d406e7972dd47c54959281782e05f52c8a10c95
ARM: cpuidle: Don't register the driver when back-end init returns -ENXIO

commit 763f191af51f127cf8e69cd361f50bf6180768a5 upstream.

There's no point to register the cpuidle driver for the current CPU, when
the initialization of the arch specific back-end data fails by returning
-ENXIO.

Instead, let's re-order the sequence to its original flow, by first trying
to initialize the back-end part and then act accordingly on the returned
error code. Additionally, let's print the error message, no matter of what
error code that was returned.

Fixes: a0d46a3dfdc3 (ARM: cpuidle: Register per cpuidle device)
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: 4.19+ <stable@vger.kernel.org> # v4.19+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cpuidle/cpuidle-arm.c