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/accel | |
parent | 8e3829c61b489933e58f671ac111a2f1980563d4 (diff) | |
download | linux-f4e4b9558bc696cc89de460e754d3fecb50b13cb.tar.bz2 |
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/accel')
-rw-r--r-- | drivers/staging/iio/accel/adis16201_core.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/accel/adis16203_core.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/accel/adis16204_core.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/accel/adis16209_core.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/accel/adis16240_core.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/accel/kxsd9.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/accel/lis3l02dq_core.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/accel/sca3000_core.c | 2 |
8 files changed, 8 insertions, 8 deletions
diff --git a/drivers/staging/iio/accel/adis16201_core.c b/drivers/staging/iio/accel/adis16201_core.c index 204106b72d24..ec2332f568fa 100644 --- a/drivers/staging/iio/accel/adis16201_core.c +++ b/drivers/staging/iio/accel/adis16201_core.c @@ -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, diff --git a/drivers/staging/iio/accel/adis16203_core.c b/drivers/staging/iio/accel/adis16203_core.c index 22085e9dfd16..34b76c51c78b 100644 --- a/drivers/staging/iio/accel/adis16203_core.c +++ b/drivers/staging/iio/accel/adis16203_core.c @@ -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, diff --git a/drivers/staging/iio/accel/adis16204_core.c b/drivers/staging/iio/accel/adis16204_core.c index 5f2e5f11c543..02fb101aca93 100644 --- a/drivers/staging/iio/accel/adis16204_core.c +++ b/drivers/staging/iio/accel/adis16204_core.c @@ -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 */ diff --git a/drivers/staging/iio/accel/adis16209_core.c b/drivers/staging/iio/accel/adis16209_core.c index 494570508c36..4fa2229d8736 100644 --- a/drivers/staging/iio/accel/adis16209_core.c +++ b/drivers/staging/iio/accel/adis16209_core.c @@ -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, diff --git a/drivers/staging/iio/accel/adis16240_core.c b/drivers/staging/iio/accel/adis16240_core.c index b30b7874ffb0..dafc0d8cbf63 100644 --- a/drivers/staging/iio/accel/adis16240_core.c +++ b/drivers/staging/iio/accel/adis16240_core.c @@ -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, diff --git a/drivers/staging/iio/accel/kxsd9.c b/drivers/staging/iio/accel/kxsd9.c index 8cf7cd943c90..713469fd2ac0 100644 --- a/drivers/staging/iio/accel/kxsd9.c +++ b/drivers/staging/iio/accel/kxsd9.c @@ -186,7 +186,7 @@ error_ret: .address = KXSD9_REG_##axis, \ } -static struct iio_chan_spec kxsd9_channels[] = { +static const struct iio_chan_spec kxsd9_channels[] = { KXSD9_ACCEL_CHAN(X), KXSD9_ACCEL_CHAN(Y), KXSD9_ACCEL_CHAN(Z), { .type = IIO_VOLTAGE, diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c index 9d263484fb86..0c2b4bae0a9b 100644 --- a/drivers/staging/iio/accel/lis3l02dq_core.c +++ b/drivers/staging/iio/accel/lis3l02dq_core.c @@ -538,7 +538,7 @@ static irqreturn_t lis3l02dq_event_handler(int irq, void *private) .event_mask = LIS3L02DQ_EVENT_MASK, \ } -static struct iio_chan_spec lis3l02dq_channels[] = { +static const struct iio_chan_spec lis3l02dq_channels[] = { LIS3L02DQ_CHAN(0, IIO_MOD_X), LIS3L02DQ_CHAN(1, IIO_MOD_Y), LIS3L02DQ_CHAN(2, IIO_MOD_Z), diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c index c218d71abf1f..cc040e14adba 100644 --- a/drivers/staging/iio/accel/sca3000_core.c +++ b/drivers/staging/iio/accel/sca3000_core.c @@ -450,7 +450,7 @@ static IIO_DEVICE_ATTR(revision, S_IRUGO, sca3000_show_rev, NULL, 0); .event_mask = SCA3000_EVENT_MASK, \ } -static struct iio_chan_spec sca3000_channels[] = { +static const struct iio_chan_spec sca3000_channels[] = { SCA3000_CHAN(0, IIO_MOD_X), SCA3000_CHAN(1, IIO_MOD_Y), SCA3000_CHAN(2, IIO_MOD_Z), |