1 From 341844c7e06afccd64261719fa388339a589b0a4 Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@nbd.name>
3 Date: Sun, 22 Jul 2018 12:53:04 +0200
4 Subject: [PATCH] soc: qcom: spm: add SCM probe dependency
6 Check for SCM availability before attempting to use SPM. SPM probe will
9 Signed-off-by: Felix Fietkau <nbd@nbd.name>
10 Signed-off-by: John Crispin <john@phrozen.org>
12 drivers/soc/qcom/spm.c | 3 +++
13 1 file changed, 3 insertions(+)
15 diff --git a/drivers/soc/qcom/spm.c b/drivers/soc/qcom/spm.c
16 index f9d7a85b2822..53807e839664 100644
17 --- a/drivers/soc/qcom/spm.c
18 +++ b/drivers/soc/qcom/spm.c
19 @@ -219,6 +219,9 @@ static int __init qcom_cpuidle_init(struct device_node *cpu_node, int cpu)
21 bool use_scm_power_down = false;
23 + if (!qcom_scm_is_available())
24 + return -EPROBE_DEFER;
27 state_node = of_parse_phandle(cpu_node, "cpu-idle-states", i);