summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/berlin2-adc.c
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2015-07-28 01:39:02 +0300
committerJonathan Cameron <jic23@kernel.org>2015-08-02 21:08:45 +0300
commit546384c968383b512ba50f77c76ae7bdfa321f31 (patch)
treec58913a3657b33dc7ce2cf4ba95905a0cf74afe7 /drivers/iio/adc/berlin2-adc.c
parent609e9d88f277bfe83392595745cc3976d42125b2 (diff)
downloadlinux-546384c968383b512ba50f77c76ae7bdfa321f31.tar.xz
iio:adc:berlin2-adc: use channel-array size directly
Drop the otherwise unused definition of the channel-array size and use it directly in _probe - makes it a bit more obvious. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/adc/berlin2-adc.c')
-rw-r--r--drivers/iio/adc/berlin2-adc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/iio/adc/berlin2-adc.c b/drivers/iio/adc/berlin2-adc.c
index e04b7734df1d..3aaf3a975c79 100644
--- a/drivers/iio/adc/berlin2-adc.c
+++ b/drivers/iio/adc/berlin2-adc.c
@@ -103,7 +103,6 @@ static const struct iio_chan_spec berlin2_adc_channels[] = {
BERLIN2_ADC_CHANNEL(7, IIO_VOLTAGE), /* reserved */
IIO_CHAN_SOFT_TIMESTAMP(8), /* timestamp */
};
-#define BERLIN2_N_CHANNELS ARRAY_SIZE(berlin2_adc_channels)
static int berlin2_adc_read(struct iio_dev *indio_dev, int channel)
{
@@ -324,8 +323,8 @@ static int berlin2_adc_probe(struct platform_device *pdev)
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->info = &berlin2_adc_info;
- indio_dev->num_channels = BERLIN2_N_CHANNELS;
indio_dev->channels = berlin2_adc_channels;
+ indio_dev->num_channels = ARRAY_SIZE(berlin2_adc_channels);
/* Power up the ADC */
regmap_update_bits(priv->regmap, BERLIN2_SM_CTRL,