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)
commitf5d017938e7a6517b85f7fd215213a28e11291fb
treeab7554530515b5fdc44fd8980fd792afee0ce330
parent78289b4a58b58e9a8a76ef43ffbaf04a097e33c6
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