提交 546384c9 编写于 作者: H Hartmut Knaack 提交者: Jonathan Cameron

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: NHartmut Knaack <knaack.h@gmx.de>
Acked-by: NAntoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 609e9d88
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册