]> git.baikalelectronics.ru Git - kernel.git/commit
iio: core: pass parent device as parameter during allocation
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Wed, 3 Jun 2020 11:40:18 +0000 (14:40 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 14 Jun 2020 10:49:56 +0000 (11:49 +0100)
commit2007592b2d07581102a2148e45fb59f8190872da
treef7a3c01411d7a03ca8f48ab9e8825c1b87048708
parentba55b99f36402c8fee303e198b2f26c0b53e0588
iio: core: pass parent device as parameter during allocation

The change passes the parent device to the iio_device_alloc() call. This
also updates the devm_iio_device_alloc() call to consider the device object
as the parent device by default.

Having it passed like this, should ensure that any IIO device object
already has a device object as parent, allowing for neater control, like
passing the 'indio_dev' object for other stuff [like buffers/triggers/etc],
and potentially creating iiom_xxx(indio_dev) functions.

With this patch, only the 'drivers/platform/x86/toshiba_acpi.c' needs an
update to pass the parent object as a parameter.

In the next patch all devm_iio_device_alloc() calls will be handled.

Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dummy/iio_simple_dummy.c
drivers/iio/industrialio-core.c
drivers/platform/x86/toshiba_acpi.c
drivers/staging/iio/Documentation/device.txt
include/linux/iio/iio.h