Skip to contentSkip to conversation

iio: consumer: Mark struct iio_channel parameter to iio_get_channel_type() const

PATCH New Jonathan Cameron 1 participant 1 message Aug 21, 2022 IIO

lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

PATCH v2 1/1 iio: consumer: Mark struct iio_channel parameter to iio_get_channel_type() const

From: Jonathan Cameron <[email protected]>

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

---
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(-)
drivers/iio/inkern.c +1 -1
index 872fd5c24147..ac47cd453d1b 100644
@@ -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;
include/linux/iio/consumer.h +1 -1
index 6802596b017c..a73c67baae2a 100644
@@ -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);
 
 /**
Signature · 1 line
2.37.2