summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-omap2-mcspi.c
diff options
context:
space:
mode:
authorVikram N <vicky773@gmail.com>2016-09-30 16:23:11 +0200
committerMark Brown <broonie@kernel.org>2016-10-21 13:09:51 +0200
commitaf9e53fef7015e1e4fe3f32b35e839df392bf4d6 (patch)
treeee1f67da8055aff5daabca561cf4b1612da4415e /drivers/spi/spi-omap2-mcspi.c
parentLinux 4.9-rc1 (diff)
downloadlinux-af9e53fef7015e1e4fe3f32b35e839df392bf4d6.tar.xz
linux-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;