iio: inkern: introduce devm_iio_map_array_register() short-hand function
authorAlexandru Ardelean <aardelean@deviqon.com>
Fri, 3 Sep 2021 07:29:13 +0000 (10:29 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 19 Oct 2021 07:27:34 +0000 (08:27 +0100)
commit25c02edfd41f0dd7aad9115149625d7e7f441b7d
tree27cf86d5c7a978631826346fea2fc1595b3ad9b5
parentc5fd034a2ac99117f67f9ab7653912af33f9106e
iio: inkern: introduce devm_iio_map_array_register() short-hand function

This change introduces a device-managed variant to the
iio_map_array_register() function. It's a simple implementation of calling
iio_map_array_register() and registering a callback to
iio_map_array_unregister() with the devm_add_action_or_reset().

The function uses an explicit 'dev' parameter to bind the unwinding to. It
could have been implemented to implicitly use the parent of the IIO device,
however it shouldn't be too expensive to callers to just specify to which
device object to bind this unwind call.
It would make the API a bit more flexible.

Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210903072917.45769-2-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Documentation/driver-api/driver-model/devres.rst
drivers/iio/inkern.c
include/linux/iio/driver.h