]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
soc: qcom: pd-mapper: Simplify code using of_root to get root device tree node
authorVladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Tue, 24 Feb 2026 11:02:13 +0000 (13:02 +0200)
committerBjorn Andersson <andersson@kernel.org>
Mon, 16 Mar 2026 01:26:41 +0000 (20:26 -0500)
A few lines of code are removed by using the global non-NULL of_root
pointer to access the root device tree node instead of its recalculation.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260224110213.3929063-1-vladimir.zapolskiy@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/soc/qcom/qcom_pd_mapper.c

index 0bccc23c0a58c8365bf98e0ddee4a5c4ae1dc940..c54b3cec508d95767ab1fe8e5d7e917a1ca06595 100644 (file)
@@ -626,15 +626,9 @@ static struct qcom_pdm_data *qcom_pdm_start(void)
        const struct qcom_pdm_domain_data * const *domains;
        const struct of_device_id *match;
        struct qcom_pdm_data *data;
-       struct device_node *root;
        int ret, i;
 
-       root = of_find_node_by_path("/");
-       if (!root)
-               return ERR_PTR(-ENODEV);
-
-       match = of_match_node(qcom_pdm_domains, root);
-       of_node_put(root);
+       match = of_match_node(qcom_pdm_domains, of_root);
        if (!match) {
                pr_notice("PDM: no support for the platform, userspace daemon might be required.\n");
                return ERR_PTR(-ENODEV);