i2c: amd8111: switch to devm_ functions
authorFilippo MuscherĂ  <filippo.muschera@gmail.com>
Mon, 2 Feb 2026 13:13:04 +0000 (14:13 +0100)
committerAndi Shyti <andi.shyti@kernel.org>
Sat, 7 Feb 2026 00:20:04 +0000 (01:20 +0100)
commit76b70625615f6e82add8b9354508e081fff3686a
tree4b07ac9938fcdc1ad49a3f621e0227f866527464
parentf6dd64d61aba6d038434ce17e05fdcd4b67e4076
i2c: amd8111: switch to devm_ functions

Use devm_kzalloc() to manage the memory allocation of the smbus structure
and devm_request_region() to manage the I/O port region.

This simplifies the error handling paths in the probe function by removing
manual cleanup and allows for the removal of the explicit cleanup in the
remove function.

Signed-off-by: Filippo MuscherĂ  <filippo.muschera@gmail.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260202131304.8524-2-filippo.muschera@gmail.com
drivers/i2c/busses/i2c-amd8111.c