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: 3ccea1dede ("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>
This commit is contained in:
Jinjie Ruan 2024-08-26 20:59:12 +08:00 committed by Mark Brown
parent 2fe6102bf0
commit c2ea9b8a53
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -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);