[PATCH] cpuidle: qcom_spm: make driver multi-arch friendly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avoid returning -EPROBE_DEFER from spm_cpuidle_drv_probe() on non-qcom
based systems. This makes the driver multi-arch friendly again after
commit 60f3692b5f0b ("cpuidle: qcom_spm: Detach state machine from main
SPM handling").

Signed-off-by: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
---
This fixes the issue I've reported some time ago:
https://lore.kernel.org/all/86e3e09f-a8d7-3dff-3fc6-ddd7d30c5d78@xxxxxxxxxxx/
---
 drivers/cpuidle/cpuidle-qcom-spm.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/cpuidle/cpuidle-qcom-spm.c b/drivers/cpuidle/cpuidle-qcom-spm.c
index 01e77913a414..1ee056fdfbb8 100644
--- a/drivers/cpuidle/cpuidle-qcom-spm.c
+++ b/drivers/cpuidle/cpuidle-qcom-spm.c
@@ -129,12 +129,26 @@ static int spm_cpuidle_register(struct device *cpuidle_dev, int cpu)
 	return cpuidle_register(&data->cpuidle_driver, NULL);
 }
 
+static int spm_dev_check(struct device_driver *drv, void *data)
+{
+	if (strcmp(drv->name, "qcom_spm") == 0) {
+		struct device_node *np;
+
+		np = of_find_matching_node(NULL, drv->of_match_table);
+		if (np) {
+			of_node_put(np);
+			return -EPROBE_DEFER;
+		}
+	}
+	return -ENODEV;
+}
+
 static int spm_cpuidle_drv_probe(struct platform_device *pdev)
 {
 	int cpu, ret;
 
 	if (!qcom_scm_is_available())
-		return -EPROBE_DEFER;
+		return bus_for_each_drv(pdev->dev.bus, NULL, NULL, spm_dev_check);
 
 	for_each_possible_cpu(cpu) {
 		ret = spm_cpuidle_register(&pdev->dev, cpu);
-- 
2.17.1




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux