From: David Hunter <david.hunter.linux@gmail.com>
To: david@lechnology.com, mturquette@baylibre.com, sboyd@kernel.org,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: David Hunter <david.hunter.linux@gmail.com>,
julia.lawall@inria.fr, skhan@linuxfoundation.org,
javier.carrasco.cruz@gmail.com
Subject: [PATCH] da8xx-cfgchip.c: replace of_node_put with __free improves cleanup
Date: Sat, 20 Jul 2024 11:24:47 -0400 [thread overview]
Message-ID: <20240720152447.311442-1-david.hunter.linux@gmail.com> (raw)
The use of the __free function allows the cleanup to be based on scope
instead of on another function called later. This makes the cleanup
automatic and less susceptible to errors later.
This code was compiled without errors or warnings.
Signed-off-by: David Hunter <david.hunter.linux@gmail.com>
---
drivers/clk/davinci/da8xx-cfgchip.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/clk/davinci/da8xx-cfgchip.c b/drivers/clk/davinci/da8xx-cfgchip.c
index ad2d0df43dc6..5ea0c072bfbe 100644
--- a/drivers/clk/davinci/da8xx-cfgchip.c
+++ b/drivers/clk/davinci/da8xx-cfgchip.c
@@ -749,11 +749,9 @@ static int da8xx_cfgchip_probe(struct platform_device *pdev)
clk_init = device_get_match_data(dev);
if (clk_init) {
- struct device_node *parent;
+ struct device_node *parent __free(device_node) = of_get_parent(dev->of_node);
- parent = of_get_parent(dev->of_node);
regmap = syscon_node_to_regmap(parent);
- of_node_put(parent);
} else if (pdev->id_entry && pdata) {
clk_init = (void *)pdev->id_entry->driver_data;
regmap = pdata->cfgchip;
--
2.34.1
next reply other threads:[~2024-07-20 15:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-20 15:24 David Hunter [this message]
2024-07-20 16:18 ` [PATCH] da8xx-cfgchip.c: replace of_node_put with __free improves cleanup David Lechner
2024-07-29 23:19 ` Stephen Boyd
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=20240720152447.311442-1-david.hunter.linux@gmail.com \
--to=david.hunter.linux@gmail.com \
--cc=david@lechnology.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=julia.lawall@inria.fr \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox