diff mbox series

gpu: ipu-v3: Removal of of_node_put with __free for auto cleanup

Message ID 20240702144836.1001916-1-jain.abhinav177@gmail.com (mailing list archive)
State New, archived
Headers show
Series gpu: ipu-v3: Removal of of_node_put with __free for auto cleanup | expand

Commit Message

Abhinav Jain July 2, 2024, 2:48 p.m. UTC
Remove of_node_put from device node of_node.
Move declaration to initialization for ensuring scope sanity.

Signed-off-by: Abhinav Jain <jain.abhinav177@gmail.com>
---
 drivers/gpu/ipu-v3/ipu-common.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c
index 71ec1e7f657a..f8cc3f721d2a 100644
--- a/drivers/gpu/ipu-v3/ipu-common.c
+++ b/drivers/gpu/ipu-v3/ipu-common.c
@@ -1150,10 +1150,10 @@  static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base)
 	for (i = 0; i < ARRAY_SIZE(client_reg); i++) {
 		struct ipu_platform_reg *reg = &client_reg[i];
 		struct platform_device *pdev;
-		struct device_node *of_node;
-
 		/* Associate subdevice with the corresponding port node */
-		of_node = of_graph_get_port_by_id(dev->of_node, i);
+		struct device_node *of_node __free(device_node) =
+			of_graph_get_port_by_id(dev->of_node, i);
+
 		if (!of_node) {
 			dev_info(dev,
 				 "no port@%d node in %pOF, not using %s%d\n",