summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorJinjie Ruan <ruanjinjie@huawei.com>2024-08-26 20:59:12 +0800
committerMark Brown <broonie@kernel.org>2024-08-28 22:11:16 +0100
commitc2ea9b8a536bd18b7632d4d998c20e1af9319c32 (patch)
tree2ec7f3e0cbc3d96a1d8efc9b7bbd54ff5f002912 /drivers/spi
parent2fe6102bf01a5f4f48f211c2e5c8a274342fccb1 (diff)
spi: atmel-quadspi: Fix uninitialized res
The second platform_get_resource_byname() can not be replaced with devm_platform_ioremap_resource_byname(), because the intermediate "res" is used to assign for "aq->mmap_size". Fixes: 3ccea1dedef3 ("spi: atmel-quadspi: Simpify resource lookup") Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Acked-by: Hari Prasath Gujulan Elango <hari.prasathge@microchip.com> Link: https://patch.msgid.link/20240826125913.3434305-2-ruanjinjie@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/atmel-quadspi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c
index 2b5c72176711..56dd8dcb86cb 100644
--- a/drivers/spi/atmel-quadspi.c
+++ b/drivers/spi/atmel-quadspi.c
@@ -608,7 +608,8 @@ static int atmel_qspi_probe(struct platform_device *pdev)
}
/* Map the AHB memory */
- aq->mem = devm_platform_ioremap_resource_byname(pdev, "qspi_mmap");
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qspi_mmap");
+ aq->mem = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(aq->mem)) {
dev_err(&pdev->dev, "missing AHB memory\n");
return PTR_ERR(aq->mem);