Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Vikram N and committed by
Mark Brown
af9e53fe 1001354c

+2 -4
+2 -4
drivers/spi/spi-omap2-mcspi.c
··· 1391 1391 goto free_master; 1392 1392 } 1393 1393 1394 - r->start += regs_offset; 1395 - r->end += regs_offset; 1396 - mcspi->phys = r->start; 1397 - 1398 1394 mcspi->base = devm_ioremap_resource(&pdev->dev, r); 1399 1395 if (IS_ERR(mcspi->base)) { 1400 1396 status = PTR_ERR(mcspi->base); 1401 1397 goto free_master; 1402 1398 } 1399 + mcspi->phys = r->start + regs_offset; 1400 + mcspi->base += regs_offset; 1403 1401 1404 1402 mcspi->dev = &pdev->dev; 1405 1403