Skip to content

Commit c2ea9b8

Browse files
Jinjie Ruanbroonie
authored andcommitted
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: 3ccea1d ("spi: atmel-quadspi: Simpify resource lookup") Signed-off-by: Jinjie Ruan <[email protected]> Acked-by: Hari Prasath Gujulan Elango <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 2fe6102 commit c2ea9b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/spi/atmel-quadspi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,8 @@ static int atmel_qspi_probe(struct platform_device *pdev)
608608
}
609609

610610
/* Map the AHB memory */
611-
aq->mem = devm_platform_ioremap_resource_byname(pdev, "qspi_mmap");
611+
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qspi_mmap");
612+
aq->mem = devm_ioremap_resource(&pdev->dev, res);
612613
if (IS_ERR(aq->mem)) {
613614
dev_err(&pdev->dev, "missing AHB memory\n");
614615
return PTR_ERR(aq->mem);

0 commit comments

Comments
 (0)