Skip to content

Commit af9e53f

Browse files
vikramn89broonie
authored andcommitted
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>
1 parent 1001354 commit af9e53f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎drivers/spi/spi-omap2-mcspi.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,15 +1391,13 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
13911391
goto free_master;
13921392
}
13931393

1394-
r->start += regs_offset;
1395-
r->end += regs_offset;
1396-
mcspi->phys = r->start;
1397-
13981394
mcspi->base = devm_ioremap_resource(&pdev->dev, r);
13991395
if (IS_ERR(mcspi->base)) {
14001396
status = PTR_ERR(mcspi->base);
14011397
goto free_master;
14021398
}
1399+
mcspi->phys = r->start + regs_offset;
1400+
mcspi->base += regs_offset;
14031401

14041402
mcspi->dev = &pdev->dev;
14051403

0 commit comments

Comments
 (0)