Skip to content

Commit 7ff88f0

Browse files
committed
iio: code: mark iio_dev as const in iio_buffer_enabled
The iio_dev struct is never modified inside the method, mark it as const. This allows to be called from get_current_scan_type, and is useful when the scan_type depends on the buffer state. Signed-off-by: Jorge Marques <jorge.marques@analog.com>
1 parent aed2711 commit 7ff88f0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/iio/industrialio-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ EXPORT_SYMBOL_GPL(iio_device_id);
207207
*
208208
* Returns: True, if the buffer is enabled.
209209
*/
210-
bool iio_buffer_enabled(struct iio_dev *indio_dev)
210+
bool iio_buffer_enabled(const struct iio_dev *indio_dev)
211211
{
212212
struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev);
213213

include/linux/iio/iio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ struct iio_dev {
633633

634634
int iio_device_id(struct iio_dev *indio_dev);
635635
int iio_device_get_current_mode(struct iio_dev *indio_dev);
636-
bool iio_buffer_enabled(struct iio_dev *indio_dev);
636+
bool iio_buffer_enabled(const struct iio_dev *indio_dev);
637637

638638
const struct iio_chan_spec
639639
*iio_find_channel_from_si(struct iio_dev *indio_dev, int si);

0 commit comments

Comments
 (0)