Skip to content
Commit 9dabaf5e authored by Grygorii Strashko's avatar Grygorii Strashko Committed by Jonathan Cameron
Browse files

iio: core: implement devm_iio_device_alloc/devm_iio_device_free



Add a resource managed devm_iio_device_alloc()/devm_iio_device_free()
to automatically clean up any allocations made by IIO drivers,
thus leading to simplified IIO drivers code.

In addition, this will allow IIO drivers to use other devm_*() API
(like devm_request_irq) and don't care about the race between
iio_device_free() and the release of resources by Device core
during driver removing.

Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: default avatarOleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Tested-by: default avatarOleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Reviewed-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 60b188f0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment