Commit f4e4b955 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Jonathan Cameron
Browse files

staging:iio: Constify static iio_chan_spec arrays



The per driver iio_chan_spec arrays are usually shared between multiple device
instances. So a single device instance may not modify the iio_chan_spec array
since this would also affect the other device instances. To make this restriction
explicit mark the per driver iio_chan_spec arrays as const.

Conversion was done automatically using the following coccinelle semantic patch:

// <smpl>
@disable optional_qualifier@
identifier channels;
@@
static
+const
struct iio_chan_spec channels[] = ...;
// </smpl>

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 8e3829c6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -390,7 +390,7 @@ static int adis16201_write_raw(struct iio_dev *indio_dev,
	return -EINVAL;
}

static struct iio_chan_spec adis16201_channels[] = {
static const struct iio_chan_spec adis16201_channels[] = {
	{
		.type = IIO_VOLTAGE,
		.indexed = 1,
+1 −1
Original line number Diff line number Diff line
@@ -355,7 +355,7 @@ static int adis16203_read_raw(struct iio_dev *indio_dev,
	}
}

static struct iio_chan_spec adis16203_channels[] = {
static const struct iio_chan_spec adis16203_channels[] = {
	{
		.type = IIO_VOLTAGE,
		.indexed = 1,
+1 −1
Original line number Diff line number Diff line
@@ -397,7 +397,7 @@ static int adis16204_write_raw(struct iio_dev *indio_dev,
	return -EINVAL;
}

static struct iio_chan_spec adis16204_channels[] = {
static const struct iio_chan_spec adis16204_channels[] = {
	{
		.type = IIO_VOLTAGE,
		.indexed = 1, /* Note was not previously indexed */
+1 −1
Original line number Diff line number Diff line
@@ -390,7 +390,7 @@ static int adis16209_read_raw(struct iio_dev *indio_dev,
	return -EINVAL;
}

static struct iio_chan_spec adis16209_channels[] = {
static const struct iio_chan_spec adis16209_channels[] = {
	{
		.type = IIO_VOLTAGE,
		.indexed = 1,
+1 −1
Original line number Diff line number Diff line
@@ -448,7 +448,7 @@ static int adis16240_write_raw(struct iio_dev *indio_dev,
	return -EINVAL;
}

static struct iio_chan_spec adis16240_channels[] = {
static const struct iio_chan_spec adis16240_channels[] = {
	{
		.type = IIO_VOLTAGE,
		.indexed = 1,
Loading