diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-08-09 08:51:00 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-08-14 20:27:42 +0100 |
commit | f4e4b9558bc696cc89de460e754d3fecb50b13cb (patch) | |
tree | 93fee7877db90456bae2bfebe61ed14d70fb2acf /drivers/staging/iio/adc/max1363_core.c | |
parent | 8e3829c61b489933e58f671ac111a2f1980563d4 (diff) |
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: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio/adc/max1363_core.c')
-rw-r--r-- | drivers/staging/iio/adc/max1363_core.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c index 6799ce23a395..816bb2c2e0c5 100644 --- a/drivers/staging/iio/adc/max1363_core.c +++ b/drivers/staging/iio/adc/max1363_core.c @@ -335,12 +335,12 @@ static const enum max1363_modes max1363_mode_list[] = { IIO_CHAN_SOFT_TIMESTAMP(8) \ } -static struct iio_chan_spec max1036_channels[] = MAX1363_4X_CHANS(8, 0); -static struct iio_chan_spec max1136_channels[] = MAX1363_4X_CHANS(10, 0); -static struct iio_chan_spec max1236_channels[] = MAX1363_4X_CHANS(12, 0); -static struct iio_chan_spec max1361_channels[] = +static const struct iio_chan_spec max1036_channels[] = MAX1363_4X_CHANS(8, 0); +static const struct iio_chan_spec max1136_channels[] = MAX1363_4X_CHANS(10, 0); +static const struct iio_chan_spec max1236_channels[] = MAX1363_4X_CHANS(12, 0); +static const struct iio_chan_spec max1361_channels[] = MAX1363_4X_CHANS(10, MAX1363_EV_M); -static struct iio_chan_spec max1363_channels[] = +static const struct iio_chan_spec max1363_channels[] = MAX1363_4X_CHANS(12, MAX1363_EV_M); /* Applies to max1236, max1237 */ @@ -392,9 +392,9 @@ static const enum max1363_modes max1238_mode_list[] = { MAX1363_CHAN_B(11, 10, d11m10, 23, bits, 0), \ IIO_CHAN_SOFT_TIMESTAMP(24) \ } -static struct iio_chan_spec max1038_channels[] = MAX1363_12X_CHANS(8); -static struct iio_chan_spec max1138_channels[] = MAX1363_12X_CHANS(10); -static struct iio_chan_spec max1238_channels[] = MAX1363_12X_CHANS(12); +static const struct iio_chan_spec max1038_channels[] = MAX1363_12X_CHANS(8); +static const struct iio_chan_spec max1138_channels[] = MAX1363_12X_CHANS(10); +static const struct iio_chan_spec max1238_channels[] = MAX1363_12X_CHANS(12); static const enum max1363_modes max11607_mode_list[] = { _s0, _s1, _s2, _s3, @@ -433,9 +433,9 @@ static const enum max1363_modes max11608_mode_list[] = { MAX1363_CHAN_B(7, 6, d7m6, 15, bits, 0), \ IIO_CHAN_SOFT_TIMESTAMP(16) \ } -static struct iio_chan_spec max11602_channels[] = MAX1363_8X_CHANS(8); -static struct iio_chan_spec max11608_channels[] = MAX1363_8X_CHANS(10); -static struct iio_chan_spec max11614_channels[] = MAX1363_8X_CHANS(12); +static const struct iio_chan_spec max11602_channels[] = MAX1363_8X_CHANS(8); +static const struct iio_chan_spec max11608_channels[] = MAX1363_8X_CHANS(10); +static const struct iio_chan_spec max11614_channels[] = MAX1363_8X_CHANS(12); static const enum max1363_modes max11644_mode_list[] = { _s0, _s1, s0to1, d0m1, d1m0, @@ -449,8 +449,8 @@ static const enum max1363_modes max11644_mode_list[] = { IIO_CHAN_SOFT_TIMESTAMP(4) \ } -static struct iio_chan_spec max11646_channels[] = MAX1363_2X_CHANS(10); -static struct iio_chan_spec max11644_channels[] = MAX1363_2X_CHANS(12); +static const struct iio_chan_spec max11646_channels[] = MAX1363_2X_CHANS(10); +static const struct iio_chan_spec max11644_channels[] = MAX1363_2X_CHANS(12); enum { max1361, max1362, |