Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH next] drivers: soc: qcom: Auto cleanup using __free(device_node)
@ 2024-04-07  7:23 Prabhav Kumar Vaish
  2024-05-19 18:40 ` prabhav kumar
  2024-05-21 19:20 ` Bjorn Andersson
  0 siblings, 2 replies; 6+ messages in thread
From: Prabhav Kumar Vaish @ 2024-04-07  7:23 UTC (permalink / raw)
  To: andersson, konrad.dybcio, linux-arm-msm, linux-kernel
  Cc: julia.lawall, javier.carrasco, skhan, Prabhav Kumar Vaish

Use automated cleanup to replace of_node_put() in qcom_smem_resolve_mem().

Signed-off-by: Prabhav Kumar Vaish <pvkumar5749404@gmail.com>
---
drivers/soc/qcom/smem.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c
index 7191fa0c087f..ad1cf8dcc6ec 100644
--- a/drivers/soc/qcom/smem.c
+++ b/drivers/soc/qcom/smem.c
@@ -1032,18 +1032,16 @@ static int qcom_smem_resolve_mem(struct qcom_smem *smem, const char *name,
 				 struct smem_region *region)
 {
 	struct device *dev = smem->dev;
-	struct device_node *np;
 	struct resource r;
 	int ret;
+	struct device_node *np __free(device_node) = of_parse_phandle(dev->of_node, name, 0);
 
-	np = of_parse_phandle(dev->of_node, name, 0);
 	if (!np) {
 		dev_err(dev, "No %s specified\n", name);
 		return -EINVAL;
 	}
 
 	ret = of_address_to_resource(np, 0, &r);
-	of_node_put(np);
 	if (ret)
 		return ret;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-22 15:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-07  7:23 [PATCH next] drivers: soc: qcom: Auto cleanup using __free(device_node) Prabhav Kumar Vaish
2024-05-19 18:40 ` prabhav kumar
2024-05-21 19:20 ` Bjorn Andersson
2024-05-21 19:31   ` prabhav kumar
2024-05-21 19:43     ` Bjorn Andersson
2024-05-22 15:32       ` prabhav kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox