[PATCH v2] iio: consumer: Mark struct iio_channel parameter to iio_get_channel_type() const

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>

This accessor is only reading data via this pointer, so make the fact
it is const explicit.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>

---
v2: the content to match the description. ooops.

Used in a clean up to sound/soc/samsung/aries_wm8994 where
the struct iio_channel pointer is marked const.
---
 drivers/iio/inkern.c         | 2 +-
 include/linux/iio/consumer.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
index 872fd5c24147..ac47cd453d1b 100644
--- a/drivers/iio/inkern.c
+++ b/drivers/iio/inkern.c
@@ -912,7 +912,7 @@ int iio_read_max_channel_raw(struct iio_channel *chan, int *val)
 }
 EXPORT_SYMBOL_GPL(iio_read_max_channel_raw);
 
-int iio_get_channel_type(struct iio_channel *chan, enum iio_chan_type *type)
+int iio_get_channel_type(const struct iio_channel *chan, enum iio_chan_type *type)
 {
 	struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(chan->indio_dev);
 	int ret = 0;
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
index 6802596b017c..a73c67baae2a 100644
--- a/include/linux/iio/consumer.h
+++ b/include/linux/iio/consumer.h
@@ -335,7 +335,7 @@ int iio_read_avail_channel_attribute(struct iio_channel *chan,
  *
  * returns the enum iio_chan_type of the channel
  */
-int iio_get_channel_type(struct iio_channel *channel,
+int iio_get_channel_type(const struct iio_channel *channel,
 			 enum iio_chan_type *type);
 
 /**
-- 
2.37.2




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux