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/meter | |
parent | staging:iio:adis16220: Use kobj_to_dev instead of open-coding it (diff) | |
download | linux-dev-f4e4b9558bc696cc89de460e754d3fecb50b13cb.tar.xz linux-dev-f4e4b9558bc696cc89de460e754d3fecb50b13cb.zip |
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/meter')
-rw-r--r-- | drivers/staging/iio/meter/ade7758.h | 2 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7758_core.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/iio/meter/ade7758.h b/drivers/staging/iio/meter/ade7758.h index ec202b4ecfb2..1e11ad5ae5a4 100644 --- a/drivers/staging/iio/meter/ade7758.h +++ b/drivers/staging/iio/meter/ade7758.h @@ -122,7 +122,7 @@ struct ade7758_state { u8 *tx; u8 *rx; struct mutex buf_lock; - struct iio_chan_spec *ade7758_ring_channels; + const struct iio_chan_spec *ade7758_ring_channels; struct spi_transfer ring_xfer[4]; struct spi_message ring_msg; /* diff --git a/drivers/staging/iio/meter/ade7758_core.c b/drivers/staging/iio/meter/ade7758_core.c index 7014a0078446..6d3725a1cd78 100644 --- a/drivers/staging/iio/meter/ade7758_core.c +++ b/drivers/staging/iio/meter/ade7758_core.c @@ -661,7 +661,7 @@ static const struct attribute_group ade7758_attribute_group = { .attrs = ade7758_attributes, }; -static struct iio_chan_spec ade7758_channels[] = { +static const struct iio_chan_spec ade7758_channels[] = { { .type = IIO_VOLTAGE, .indexed = 1, |