summaryrefslogtreecommitdiff
path: root/drivers/staging/iio
diff options
context:
space:
mode:
authorAlexandru Ardelean <alexandru.ardelean@analog.com>2020-06-03 14:40:18 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-06-14 11:49:56 +0100
commit78289b4a58b58e9a8a76ef43ffbaf04a097e33c6 (patch)
treef7a3c01411d7a03ca8f48ab9e8825c1b87048708 /drivers/staging/iio
parent9ca39411f9a9c833727750431da8dfd96ff80005 (diff)
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>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r--drivers/staging/iio/Documentation/device.txt4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/iio/Documentation/device.txt b/drivers/staging/iio/Documentation/device.txt
index ec42544a46aa..0d1275b1eb3f 100644
--- a/drivers/staging/iio/Documentation/device.txt
+++ b/drivers/staging/iio/Documentation/device.txt
@@ -8,7 +8,7 @@ The crucial structure for device drivers in iio is iio_dev.
First allocate one using:
-struct iio_dev *indio_dev = iio_device_alloc(sizeof(struct chip_state));
+struct iio_dev *indio_dev = iio_device_alloc(parent, sizeof(struct chip_state));
where chip_state is a structure of local state data for this instance of
the chip.
@@ -16,8 +16,6 @@ That data can be accessed using iio_priv(struct iio_dev *).
Then fill in the following:
-- indio_dev->dev.parent
- Struct device associated with the underlying hardware.
- indio_dev->name
Name of the device being driven - made available as the name
attribute in sysfs.