spi: spi-s3c64xx.c: Remove of_node_put for auto cleanup
authorShivani Gupta <shivani07g@gmail.com>
Thu, 18 Apr 2024 00:05:05 +0000 (00:05 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 24 Apr 2024 01:27:16 +0000 (10:27 +0900)
commitabba116f601800a0c74b9a9c2c91e2eebca791c1
treeb4050fdb2dd4b78678e7531f0b3da34a6a3efb4a
parent856d9e8e9d42759b7fe6c6e13a2d6ff325b65f91
spi: spi-s3c64xx.c: Remove of_node_put for auto cleanup

Use the scope based of_node_put() cleanup in s3c64xx_spi_csinfo to
automatically release the device node with the __free() cleanup handler
Initialize data_np at the point of declaration for clarity of scope.

This change reduces the risk of memory leaks and simplifies the code by
removing manual node put call.

Suggested-by: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: Shivani Gupta <shivani07g@gmail.com>
Link: https://lore.kernel.org/r/20240418000505.731724-1-shivani07g@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-s3c64xx.c