Skip to content

Commit 04f5b9f

Browse files
lpstankusjic23
authored andcommitted
staging: iio: cdc: ad7746: avoid overwrite of num_channels
AD7745 devices don't have the CIN2 pins and therefore can't handle related channels. Forcing the number of AD7746 channels may lead to enabling more channels than what the hardware actually supports. Avoid num_channels being overwritten after first assignment. Signed-off-by: Lucas Stankus <[email protected]> Fixes: 83e416f ("staging: iio: adc: Replace, rewrite ad7745 from scratch.") Signed-off-by: Jonathan Cameron <[email protected]> Cc: <[email protected]>
1 parent b0f27fc commit 04f5b9f

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/staging/iio/cdc/ad7746.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,6 @@ static int ad7746_probe(struct i2c_client *client,
700700
indio_dev->num_channels = ARRAY_SIZE(ad7746_channels);
701701
else
702702
indio_dev->num_channels = ARRAY_SIZE(ad7746_channels) - 2;
703-
indio_dev->num_channels = ARRAY_SIZE(ad7746_channels);
704703
indio_dev->modes = INDIO_DIRECT_MODE;
705704

706705
if (pdata) {

0 commit comments

Comments
 (0)