Skip to content

Commit

Permalink
spi: omap2-mcspi: Fix modifying platform resource data
Browse files Browse the repository at this point in the history
currently during probe the resource data gets modified and device
physical address remains valid only during first load. If the module is
unloaded and loaded again, the ioremp will be done on a incorrect address
as the resource was modified during previous module load.
This patch fixes this issue.

Signed-off-by: Vikram N <vicky773@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Vikram N authored and Mark Brown committed Oct 21, 2016
1 parent 1001354 commit af9e53f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/spi/spi-omap2-mcspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1391,15 +1391,13 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
goto free_master;
}

r->start += regs_offset;
r->end += regs_offset;
mcspi->phys = r->start;

mcspi->base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(mcspi->base)) {
status = PTR_ERR(mcspi->base);
goto free_master;
}
mcspi->phys = r->start + regs_offset;
mcspi->base += regs_offset;

mcspi->dev = &pdev->dev;

Expand Down

0 comments on commit af9e53f

Please sign in to comment.