Commit c2ea9b8a authored by Jinjie Ruan's avatar Jinjie Ruan Committed by Mark Brown

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: 3ccea1de ("spi: atmel-quadspi: Simpify resource lookup")
Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
Acked-by: default avatarHari Prasath Gujulan Elango <hari.prasathge@microchip.com>
Link: https://patch.msgid.link/20240826125913.3434305-2-ruanjinjie@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2fe6102b
...@@ -608,7 +608,8 @@ static int atmel_qspi_probe(struct platform_device *pdev) ...@@ -608,7 +608,8 @@ static int atmel_qspi_probe(struct platform_device *pdev)
} }
/* Map the AHB memory */ /* 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)) { if (IS_ERR(aq->mem)) {
dev_err(&pdev->dev, "missing AHB memory\n"); dev_err(&pdev->dev, "missing AHB memory\n");
return PTR_ERR(aq->mem); return PTR_ERR(aq->mem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment