[PATCH 6/7] soc: qcom: pd-mapper: Convert to of_machine_get_match()

Geert Uytterhoeven posted 7 patches 1 month, 1 week ago
[PATCH 6/7] soc: qcom: pd-mapper: Convert to of_machine_get_match()
Posted by Geert Uytterhoeven 1 month, 1 week ago
Use the of_machine_get_match() helper instead of open-coding the same
operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
 drivers/soc/qcom/qcom_pd_mapper.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/soc/qcom/qcom_pd_mapper.c b/drivers/soc/qcom/qcom_pd_mapper.c
index dc10bc859ff4170c..8a1a18f8c859496f 100644
--- a/drivers/soc/qcom/qcom_pd_mapper.c
+++ b/drivers/soc/qcom/qcom_pd_mapper.c
@@ -615,15 +615,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_machine_get_match(qcom_pdm_domains);
 	if (!match) {
 		pr_notice("PDM: no support for the platform, userspace daemon might be required.\n");
 		return ERR_PTR(-ENODEV);
-- 
2.43.0
Re: [PATCH 6/7] soc: qcom: pd-mapper: Convert to of_machine_get_match()
Posted by Bjorn Andersson 3 weeks ago
On Mon, Mar 02, 2026 at 05:29:10PM +0100, Geert Uytterhoeven wrote:
> Use the of_machine_get_match() helper instead of open-coding the same
> operation.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Acked-by: Bjorn Andersson <andersson@kernel.org>

Regards,
Bjorn

> ---
> Compile-tested only.
> ---
>  drivers/soc/qcom/qcom_pd_mapper.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/soc/qcom/qcom_pd_mapper.c b/drivers/soc/qcom/qcom_pd_mapper.c
> index dc10bc859ff4170c..8a1a18f8c859496f 100644
> --- a/drivers/soc/qcom/qcom_pd_mapper.c
> +++ b/drivers/soc/qcom/qcom_pd_mapper.c
> @@ -615,15 +615,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_machine_get_match(qcom_pdm_domains);
>  	if (!match) {
>  		pr_notice("PDM: no support for the platform, userspace daemon might be required.\n");
>  		return ERR_PTR(-ENODEV);
> -- 
> 2.43.0
>
Re: [PATCH 6/7] soc: qcom: pd-mapper: Convert to of_machine_get_match()
Posted by Konrad Dybcio 1 month, 1 week ago
On 3/2/26 5:29 PM, Geert Uytterhoeven wrote:
> Use the of_machine_get_match() helper instead of open-coding the same
> operation.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Compile-tested only.
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad