summaryrefslogtreecommitdiff
path: root/drivers/clk/davinci
diff options
context:
space:
mode:
authorDavid Hunter <david.hunter.linux@gmail.com>2024-07-20 18:24:47 +0300
committerStephen Boyd <sboyd@kernel.org>2024-07-30 02:12:50 +0300
commitf9848cfa4bec953603dc9ffb838229e072b0193d (patch)
tree8bce99f32efd5e7bc89a0cc56c3872e369fc54da /drivers/clk/davinci
parent8400291e289ee6b2bf9779ff1c83a291501f017b (diff)
downloadlinux-f9848cfa4bec953603dc9ffb838229e072b0193d.tar.xz
da8xx-cfgchip.c: replace of_node_put with __free improves cleanup
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> Link: https://lore.kernel.org/r/20240720152447.311442-1-david.hunter.linux@gmail.com Reviewed-by: David Lechner <david@lechnology.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/davinci')
-rw-r--r--drivers/clk/davinci/da8xx-cfgchip.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/clk/davinci/da8xx-cfgchip.c b/drivers/clk/davinci/da8xx-cfgchip.c
index ec60ecb517f1..f6da66748573 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;