Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

David Hunter and committed by
Stephen Boyd
f9848cfa 8400291e

+1 -3
+1 -3
drivers/clk/davinci/da8xx-cfgchip.c
··· 749 749 750 750 clk_init = device_get_match_data(dev); 751 751 if (clk_init) { 752 - struct device_node *parent; 752 + struct device_node *parent __free(device_node) = of_get_parent(dev->of_node); 753 753 754 - parent = of_get_parent(dev->of_node); 755 754 regmap = syscon_node_to_regmap(parent); 756 - of_node_put(parent); 757 755 } else if (pdev->id_entry && pdata) { 758 756 clk_init = (void *)pdev->id_entry->driver_data; 759 757 regmap = pdata->cfgchip;