]> www.infradead.org Git - users/jedix/linux-maple.git/commit
soc: ti: knav_qmss_queue: do device_node auto cleanup
authorKousik Sanagavarapu <five231003@gmail.com>
Sun, 25 Aug 2024 08:48:44 +0000 (14:18 +0530)
committerNishanth Menon <nm@ti.com>
Wed, 28 Aug 2024 17:18:02 +0000 (12:18 -0500)
commitb0289dbf1c952c04ba48b05cc6345381999ef055
tree40f65990d0e7da11e17e08a71c04fd43678e84e7
parentdf70c0b4828bb85f1370453288a0a63d7618decf
soc: ti: knav_qmss_queue: do device_node auto cleanup

Use scope based cleanup, instead of manual of_node_put() calls, which
automatically free()s "struct device_node".

While at it, refactor the code from knav_queue_probe() into the separate
functions to make auto cleanup look more neat.

Doing the cleanup this way has the advantage of reducing the chance of
memory leaks in case we need to read from new OF nodes in the future
when we probe.

Suggested-by: Julia Lawall <julia.lawall@inria.fr>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Kousik Sanagavarapu <five231003@gmail.com>
Link: https://lore.kernel.org/r/20240825085714.10736-4-five231003@gmail.com
Signed-off-by: Nishanth Menon <nm@ti.com>
drivers/soc/ti/knav_qmss_queue.c