summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-omap2-mcspi.c
diff options
context:
space:
mode:
authorVikram N <vicky773@gmail.com>2016-09-30 19:53:11 +0530
committerMark Brown <broonie@kernel.org>2016-10-21 12:09:51 +0100
commitaf9e53fef7015e1e4fe3f32b35e839df392bf4d6 (patch)
treeee1f67da8055aff5daabca561cf4b1612da4415e /drivers/spi/spi-omap2-mcspi.c
parent1001354ca34179f3db924eb66672442a173147dc (diff)
downloadlinux-stable-af9e53fef7015e1e4fe3f32b35e839df392bf4d6.tar.gz
linux-stable-af9e53fef7015e1e4fe3f32b35e839df392bf4d6.tar.bz2
linux-stable-af9e53fef7015e1e4fe3f32b35e839df392bf4d6.zip
spi: omap2-mcspi: Fix modifying platform resource data
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>
Diffstat (limited to 'drivers/spi/spi-omap2-mcspi.c')
-rw-r--r--drivers/spi/spi-omap2-mcspi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index d5157b2222ce..3567e1dfd30d 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -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;