mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 01:09:38 -05:00
spi: atmel-quadspi: Simpify resource lookup
Use the devm_platform_ioremap_resource_byname() helper instead of calling platform_get_resource_byname() and devm_ioremap_resource() separately. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Link: https://patch.msgid.link/20240820123818.1788432-1-ruanjinjie@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
3bf2a5359b
commit
3ccea1dede
1 changed files with 2 additions and 4 deletions
|
@ -601,16 +601,14 @@ static int atmel_qspi_probe(struct platform_device *pdev)
|
||||||
aq->pdev = pdev;
|
aq->pdev = pdev;
|
||||||
|
|
||||||
/* Map the registers */
|
/* Map the registers */
|
||||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qspi_base");
|
aq->regs = devm_platform_ioremap_resource_byname(pdev, "qspi_base");
|
||||||
aq->regs = devm_ioremap_resource(&pdev->dev, res);
|
|
||||||
if (IS_ERR(aq->regs)) {
|
if (IS_ERR(aq->regs)) {
|
||||||
dev_err(&pdev->dev, "missing registers\n");
|
dev_err(&pdev->dev, "missing registers\n");
|
||||||
return PTR_ERR(aq->regs);
|
return PTR_ERR(aq->regs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Map the AHB memory */
|
/* Map the AHB memory */
|
||||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qspi_mmap");
|
aq->mem = devm_platform_ioremap_resource_byname(pdev, "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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue