diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-04-26 20:49:03 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-05-17 15:49:13 +0300 |
commit | 15ea2878bfb255099092634d28f31177f237ccd7 (patch) | |
tree | 5dad7386052e103370ac33add69795274c362fb9 /include/linux/iio | |
parent | e6cc8f2b7616f9d85e281d903f82d6f99819cd08 (diff) | |
download | linux-15ea2878bfb255099092634d28f31177f237ccd7.tar.xz |
iio: core: move @id from struct iio_dev to struct iio_dev_opaque
Continuing from Alexandru Ardelean's introduction of the split between
driver modifiable fields and those that should only be set by the core.
This could have been done in two steps to make the actual move after
introducing iio_device_id() but there seemed limited point to that
given how mechanical the majority of the patch is.
Includes fixup from Alex for missing mxs-lradc-adc conversion.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426174911.397061-2-jic23@kernel.org
Diffstat (limited to 'include/linux/iio')
-rw-r--r-- | include/linux/iio/iio-opaque.h | 2 | ||||
-rw-r--r-- | include/linux/iio/iio.h | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/iio/iio-opaque.h b/include/linux/iio/iio-opaque.h index 32addd5e790e..e66b029d99de 100644 --- a/include/linux/iio/iio-opaque.h +++ b/include/linux/iio/iio-opaque.h @@ -6,6 +6,7 @@ /** * struct iio_dev_opaque - industrial I/O device opaque information * @indio_dev: public industrial I/O device information + * @id: used to identify device internally * @event_interface: event chrdevs associated with interrupt lines * @attached_buffers: array of buffers statically attached by the driver * @attached_buffers_cnt: number of buffers in the array of statically attached buffers @@ -26,6 +27,7 @@ */ struct iio_dev_opaque { struct iio_dev indio_dev; + int id; struct iio_event_interface *event_interface; struct iio_buffer **attached_buffers; unsigned int attached_buffers_cnt; diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index f2d65e2e88b6..569861d5887a 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -488,7 +488,6 @@ struct iio_buffer_setup_ops { /** * struct iio_dev - industrial I/O device - * @id: [INTERN] used to identify device internally * @driver_module: [INTERN] used to make it harder to undercut users * @modes: [DRIVER] operating modes supported by device * @currentmode: [DRIVER] current operating mode @@ -523,7 +522,6 @@ struct iio_buffer_setup_ops { * **MUST** be accessed **ONLY** via iio_priv() helper */ struct iio_dev { - int id; struct module *driver_module; int modes; @@ -559,6 +557,8 @@ struct iio_dev { void *priv; }; +int iio_device_id(struct iio_dev *indio_dev); + const struct iio_chan_spec *iio_find_channel_from_si(struct iio_dev *indio_dev, int si); /** |