Skip to content

Commit f9848cf

Browse files
David Hunterbebarino
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: David Lechner <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 8400291 commit f9848cf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/clk/davinci/da8xx-cfgchip.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -749,11 +749,9 @@ static int da8xx_cfgchip_probe(struct platform_device *pdev)
749749

750750
clk_init = device_get_match_data(dev);
751751
if (clk_init) {
752-
struct device_node *parent;
752+
struct device_node *parent __free(device_node) = of_get_parent(dev->of_node);
753753

754-
parent = of_get_parent(dev->of_node);
755754
regmap = syscon_node_to_regmap(parent);
756-
of_node_put(parent);
757755
} else if (pdev->id_entry && pdata) {
758756
clk_init = (void *)pdev->id_entry->driver_data;
759757
regmap = pdata->cfgchip;

0 commit comments

Comments
 (0)