summaryrefslogtreecommitdiffstats
path: root/drivers/iio/industrialio-core.c
diff options
context:
space:
mode:
authorAlexandru Ardelean <alexandru.ardelean@analog.com>2020-06-30 06:57:08 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-07-07 21:24:07 +0200
commitfa83c3baa539a7ec734c7ee65fad499122f427d7 (patch)
treecd3af97af709440b17ea93b0a21e0be1cec56f23 /drivers/iio/industrialio-core.c
parentiio: core: move iio_dev's buffer_list to the private iio device object (diff)
downloadlinux-fa83c3baa539a7ec734c7ee65fad499122f427d7.tar.xz
linux-fa83c3baa539a7ec734c7ee65fad499122f427d7.zip
iio: core: move event interface on the opaque struct
Same as with other private fields, this moves the event interface reference to the opaque IIO device object, to be invisible to drivers. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/industrialio-core.c')
-rw-r--r--drivers/iio/industrialio-core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index fab5720a7901..ef5e23c33c9d 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -211,7 +211,8 @@ EXPORT_SYMBOL(iio_read_const_attr);
int iio_device_set_clock(struct iio_dev *indio_dev, clockid_t clock_id)
{
int ret;
- const struct iio_event_interface *ev_int = indio_dev->event_interface;
+ struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev);
+ const struct iio_event_interface *ev_int = iio_dev_opaque->event_interface;
ret = mutex_lock_interruptible(&indio_dev->mlock);
if (ret)
@@ -1442,7 +1443,7 @@ static int iio_device_register_sysfs(struct iio_dev *indio_dev)
attrcount += ret;
}
- if (indio_dev->event_interface)
+ if (iio_dev_opaque->event_interface)
clk = &dev_attr_current_timestamp_clock.attr;
if (indio_dev->name)