]> git.baikalelectronics.ru Git - kernel.git/commit
iio: stm32-adc: remove usage of iio_priv_to_dev() helper
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Tue, 26 May 2020 13:44:48 +0000 (16:44 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 14 Jun 2020 10:49:49 +0000 (11:49 +0100)
commit41905d32fbe76b78e7b9d476e2625af10aa1b0bc
tree42783beda08f925b23c8747a296889a35da73e57
parent3f8e207a1f45c7e5449174ff5ff78ff13e5e34c3
iio: stm32-adc: remove usage of iio_priv_to_dev() helper

We may want to get rid of the iio_priv_to_dev() helper. The reason is that
we will hide some of the members of the iio_dev structure (to prevent
drivers from accessing them directly), and that will also mean hiding the
implementation of the iio_priv_to_dev() helper inside the IIO core.

Hiding the implementation of iio_priv_to_dev() implies that some fast-paths
may not be fast anymore, so a general idea is to try to get rid of the
iio_priv_to_dev() altogether.
The iio_priv() helper won't be affected by the rework, as the iio_dev
struct will keep a reference to the private information.

For this driver, not using iio_priv_to_dev(), means reworking some paths to
pass the iio device and using iio_priv() to access the private information.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/stm32-adc.c