Skip to content

Commit

Permalink
iio: Don't initialize buffer->scan_mask in drivers
Browse files Browse the repository at this point in the history
commit 9ef1bf3 m2k branch.

The scan_mask is managed by the IIO core and should not be directly
modified by drivers. Otherwise undefined behaviour might occur.

Signed-off-by: Lars-Peter Clausen <[email protected]>
  • Loading branch information
larsclausen authored and stefpopa committed Mar 6, 2018
1 parent b2c6aaf commit a17f06c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 8 deletions.
2 changes: 0 additions & 2 deletions drivers/iio/adc/admc_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ static int axiadc_probe(struct platform_device *pdev)
if (ret)
goto err_unconfigure_ring;

*indio_dev->buffer->scan_mask = (1UL << indio_dev->num_channels) - 1;

dev_info(&pdev->dev, "ADI AIM (0x%X) at 0x%08llX mapped to 0x%p, probed ADC %s as %s\n",
st->pcore_version,
(unsigned long long)mem->start, st->regs, chip_info->name,
Expand Down
2 changes: 0 additions & 2 deletions drivers/iio/adc/admc_speed.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ static int axiadc_probe(struct platform_device *pdev)
if (ret)
goto err_unconfigure_ring;

*indio_dev->buffer->scan_mask = (1UL << chip_info->num_channels) - 1;

dev_info(&pdev->dev, "ADI AIM (0x%X) at 0x%08llX mapped to 0x%p, probed ADC %s as %s\n",
st->pcore_version, (unsigned long long)mem->start, st->regs,
chip_info->name, axiadc_read(st, ADI_REG_ID) ? "SLAVE" : "MASTER");
Expand Down
4 changes: 0 additions & 4 deletions drivers/iio/adc/cf_axi_adc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,10 +860,6 @@ static int axiadc_probe(struct platform_device *pdev)
if (ret)
goto err_unconfigure_ring;

if (indio_dev->buffer && indio_dev->buffer->scan_mask)
*indio_dev->buffer->scan_mask =
(1UL << conv->chip_info->num_channels) - 1;

dev_info(&pdev->dev, "ADI AIM (%d.%.2d.%c) at 0x%08llX mapped to 0x%p,"
" probed ADC %s as %s\n",
PCORE_VERSION_MAJOR(st->pcore_version),
Expand Down

0 comments on commit a17f06c

Please sign in to comment.