Commit 3bf2a535 authored by Jinjie Ruan's avatar Jinjie Ruan Committed by Mark Brown

spi: wpcm-fiu: Use devm_platform_ioremap_resource_byname()

Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately.
Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
Link: https://patch.msgid.link/20240820123518.1788294-1-ruanjinjie@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 429ecbef
......@@ -448,8 +448,7 @@ static int wpcm_fiu_probe(struct platform_device *pdev)
fiu = spi_controller_get_devdata(ctrl);
fiu->dev = dev;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "control");
fiu->regs = devm_ioremap_resource(dev, res);
fiu->regs = devm_platform_ioremap_resource_byname(pdev, "control");
if (IS_ERR(fiu->regs)) {
dev_err(dev, "Failed to map registers\n");
return PTR_ERR(fiu->regs);
......@@ -459,8 +458,7 @@ static int wpcm_fiu_probe(struct platform_device *pdev)
if (IS_ERR(fiu->clk))
return PTR_ERR(fiu->clk);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory");
fiu->memory = devm_ioremap_resource(dev, res);
fiu->memory = devm_platform_ioremap_resource_byname(pdev, "memory");
fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL);
if (IS_ERR(fiu->memory)) {
dev_err(dev, "Failed to map flash memory window\n");
......
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