spi: npcm-fiu: Use devm_platform_ioremap_resource_byname()
authorYang Yingliang <yangyingliang@huawei.com>
Sat, 29 Oct 2022 07:15:29 +0000 (15:15 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 31 Oct 2022 13:20:24 +0000 (13:20 +0000)
Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221029071529.3019626-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-npcm-fiu.c

index 49f6424..559d3a5 100644 (file)
@@ -699,7 +699,6 @@ static int npcm_fiu_probe(struct platform_device *pdev)
        struct spi_controller *ctrl;
        struct npcm_fiu_spi *fiu;
        void __iomem *regbase;
-       struct resource *res;
        int id, ret;
 
        ctrl = devm_spi_alloc_master(dev, sizeof(*fiu));
@@ -725,8 +724,7 @@ static int npcm_fiu_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, fiu);
        fiu->dev = dev;
 
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "control");
-       regbase = devm_ioremap_resource(dev, res);
+       regbase = devm_platform_ioremap_resource_byname(pdev, "control");
        if (IS_ERR(regbase))
                return PTR_ERR(regbase);