Commit 1793d366 authored by Yang Yingliang's avatar Yang Yingliang Committed by Mark Brown

spi: npcm-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 avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221029071529.3019626-1-yangyingliang@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 93cc2559
...@@ -699,7 +699,6 @@ static int npcm_fiu_probe(struct platform_device *pdev) ...@@ -699,7 +699,6 @@ static int npcm_fiu_probe(struct platform_device *pdev)
struct spi_controller *ctrl; struct spi_controller *ctrl;
struct npcm_fiu_spi *fiu; struct npcm_fiu_spi *fiu;
void __iomem *regbase; void __iomem *regbase;
struct resource *res;
int id, ret; int id, ret;
ctrl = devm_spi_alloc_master(dev, sizeof(*fiu)); ctrl = devm_spi_alloc_master(dev, sizeof(*fiu));
...@@ -725,8 +724,7 @@ static int npcm_fiu_probe(struct platform_device *pdev) ...@@ -725,8 +724,7 @@ static int npcm_fiu_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, fiu); platform_set_drvdata(pdev, fiu);
fiu->dev = dev; fiu->dev = dev;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "control"); regbase = devm_platform_ioremap_resource_byname(pdev, "control");
regbase = devm_ioremap_resource(dev, res);
if (IS_ERR(regbase)) if (IS_ERR(regbase))
return PTR_ERR(regbase); return PTR_ERR(regbase);
......
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