[PATCH 03/10] soc: qcom: pd-mapper: Use __cleanup() for device_node pointers
From: Kathiravan Thirumoorthy
Date: Sun Nov 16 2025 - 23:52:14 EST
Apply the __cleanup() attribute to device_node pointers to simplify
resource management and remove explicit of_node_put() calls.
Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@xxxxxxxxxxxxxxxx>
---
drivers/soc/qcom/qcom_pd_mapper.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/soc/qcom/qcom_pd_mapper.c b/drivers/soc/qcom/qcom_pd_mapper.c
index 1bcbe69688d2bc2559a1395929e5cd74d9a7a764..5713029d6527c84e8ba410cebb67bc268c6b3721 100644
--- a/drivers/soc/qcom/qcom_pd_mapper.c
+++ b/drivers/soc/qcom/qcom_pd_mapper.c
@@ -612,10 +612,10 @@ static void qcom_pdm_stop(struct qcom_pdm_data *data)
static struct qcom_pdm_data *qcom_pdm_start(void)
{
+ struct device_node *root __free(device_node) = NULL;
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("/");
@@ -623,7 +623,6 @@ static struct qcom_pdm_data *qcom_pdm_start(void)
return ERR_PTR(-ENODEV);
match = of_match_node(qcom_pdm_domains, root);
- of_node_put(root);
if (!match) {
pr_notice("PDM: no support for the platform, userspace daemon might be required.\n");
return ERR_PTR(-ENODEV);
--
2.34.1