All of lore.kernel.org
 help / color / mirror / Atom feed
From: Prabhav Kumar Vaish <pvkumar5749404@gmail.com>
To: andersson@kernel.org, konrad.dybcio@linaro.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: julia.lawall@inria.fr, javier.carrasco@wolfvision.net,
	skhan@linuxfoundation.org,
	Prabhav Kumar Vaish <pvkumar5749404@gmail.com>
Subject: [PATCH next] drivers: soc: qcom: Auto cleanup using __free(device_node)
Date: Sun,  7 Apr 2024 12:53:30 +0530	[thread overview]
Message-ID: <20240407072330.229076-1-pvkumar5749404@gmail.com> (raw)

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


                 reply	other threads:[~2024-04-07  7:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240407072330.229076-1-pvkumar5749404@gmail.com \
    --to=pvkumar5749404@gmail.com \
    --cc=andersson@kernel.org \
    --cc=javier.carrasco@wolfvision.net \
    --cc=julia.lawall@inria.fr \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.