[PATCH 02/10] soc: qcom: gsbi: Use __cleanup() for device_node pointers

From: Kathiravan Thirumoorthy
Date: Sun Nov 16 2025 - 23:52:02 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_gsbi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/soc/qcom/qcom_gsbi.c b/drivers/soc/qcom/qcom_gsbi.c
index a25d1de592f060bbf6e084bd412e3a1ef47558f4..4a195c39e223c1f4cda1becf4542d4c8a79ad688 100644
--- a/drivers/soc/qcom/qcom_gsbi.c
+++ b/drivers/soc/qcom/qcom_gsbi.c
@@ -124,8 +124,8 @@ static const struct of_device_id tcsr_dt_match[] __maybe_unused = {

static int gsbi_probe(struct platform_device *pdev)
{
+ struct device_node *tcsr_node __free(device_node) = NULL;
struct device_node *node = pdev->dev.of_node;
- struct device_node *tcsr_node;
const struct of_device_id *match;
void __iomem *base;
struct gsbi_info *gsbi;
@@ -154,7 +154,6 @@ static int gsbi_probe(struct platform_device *pdev)
else
dev_warn(&pdev->dev, "no matching TCSR\n");

- of_node_put(tcsr_node);
}
}


--
2.34.1