]> git.baikalelectronics.ru Git - kernel.git/commit
iio: core: add iio_device_set_parent() helper
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Wed, 3 Jun 2020 11:40:19 +0000 (14:40 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 14 Jun 2020 10:49:57 +0000 (11:49 +0100)
commit2e901efc9a2d45b28a4c584fd16bf76445494ad6
treeab7554530515b5fdc44fd8980fd792afee0ce330
parent2007592b2d07581102a2148e45fb59f8190872da
iio: core: add iio_device_set_parent() helper

By default, the device allocation will also assign a parent device to the
IIO device object. In cases where devm_iio_device_alloc() is used,
sometimes the parent device must be different than the device used to
manage the allocation.

In that case, this helper should be used to change the parent, hence the
requirement to call this between allocation & registration.

This pattern/requirement is not very common in the IIO space, and it may be
cleaned up later.
But until then, assigning the parent manually between allocation &
registration is slightly easier.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
include/linux/iio/iio.h