lkml.org 
[lkml]   [2021]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] cpuidle: qcom_spm: make driver multi-arch friendly
Date
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@samsung.com>
---
This fixes the issue I've reported some time ago:
https://lore.kernel.org/all/86e3e09f-a8d7-3dff-3fc6-ddd7d30c5d78@samsung.com/
---
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
\
 
 \ /
  Last update: 2021-10-20 14:08    [W:0.038 / U:1.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site