Commit 59713492 authored by Rikard Falkeborn's avatar Rikard Falkeborn Committed by Jonathan Cameron

iio: dac: ad5686: Constify static struct iio_chan_spec

These are never modified and can be made const to allow the compiler to
put it in read-only memory.

Before:
   text    data     bss     dec     hex filename
   6642   12608      64   19314    4b72 drivers/iio/dac/ad5686.o

After:
   text    data     bss     dec     hex filename
  16946    2304      64   19314    4b72 drivers/iio/dac/ad5686.o
Signed-off-by: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
Acked-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 8dd746d1
...@@ -206,12 +206,12 @@ static const struct iio_chan_spec_ext_info ad5686_ext_info[] = { ...@@ -206,12 +206,12 @@ static const struct iio_chan_spec_ext_info ad5686_ext_info[] = {
} }
#define DECLARE_AD5693_CHANNELS(name, bits, _shift) \ #define DECLARE_AD5693_CHANNELS(name, bits, _shift) \
static struct iio_chan_spec name[] = { \ static const struct iio_chan_spec name[] = { \
AD5868_CHANNEL(0, 0, bits, _shift), \ AD5868_CHANNEL(0, 0, bits, _shift), \
} }
#define DECLARE_AD5686_CHANNELS(name, bits, _shift) \ #define DECLARE_AD5686_CHANNELS(name, bits, _shift) \
static struct iio_chan_spec name[] = { \ static const struct iio_chan_spec name[] = { \
AD5868_CHANNEL(0, 1, bits, _shift), \ AD5868_CHANNEL(0, 1, bits, _shift), \
AD5868_CHANNEL(1, 2, bits, _shift), \ AD5868_CHANNEL(1, 2, bits, _shift), \
AD5868_CHANNEL(2, 4, bits, _shift), \ AD5868_CHANNEL(2, 4, bits, _shift), \
...@@ -219,7 +219,7 @@ static struct iio_chan_spec name[] = { \ ...@@ -219,7 +219,7 @@ static struct iio_chan_spec name[] = { \
} }
#define DECLARE_AD5676_CHANNELS(name, bits, _shift) \ #define DECLARE_AD5676_CHANNELS(name, bits, _shift) \
static struct iio_chan_spec name[] = { \ static const struct iio_chan_spec name[] = { \
AD5868_CHANNEL(0, 0, bits, _shift), \ AD5868_CHANNEL(0, 0, bits, _shift), \
AD5868_CHANNEL(1, 1, bits, _shift), \ AD5868_CHANNEL(1, 1, bits, _shift), \
AD5868_CHANNEL(2, 2, bits, _shift), \ AD5868_CHANNEL(2, 2, bits, _shift), \
...@@ -231,7 +231,7 @@ static struct iio_chan_spec name[] = { \ ...@@ -231,7 +231,7 @@ static struct iio_chan_spec name[] = { \
} }
#define DECLARE_AD5679_CHANNELS(name, bits, _shift) \ #define DECLARE_AD5679_CHANNELS(name, bits, _shift) \
static struct iio_chan_spec name[] = { \ static const struct iio_chan_spec name[] = { \
AD5868_CHANNEL(0, 0, bits, _shift), \ AD5868_CHANNEL(0, 0, bits, _shift), \
AD5868_CHANNEL(1, 1, bits, _shift), \ AD5868_CHANNEL(1, 1, bits, _shift), \
AD5868_CHANNEL(2, 2, bits, _shift), \ AD5868_CHANNEL(2, 2, bits, _shift), \
......
...@@ -104,7 +104,7 @@ typedef int (*ad5686_read_func)(struct ad5686_state *st, u8 addr); ...@@ -104,7 +104,7 @@ typedef int (*ad5686_read_func)(struct ad5686_state *st, u8 addr);
struct ad5686_chip_info { struct ad5686_chip_info {
u16 int_vref_mv; u16 int_vref_mv;
unsigned int num_channels; unsigned int num_channels;
struct iio_chan_spec *channels; const struct iio_chan_spec *channels;
enum ad5686_regmap_type regmap_type; enum ad5686_regmap_type regmap_type;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment