spi: mxic: Use devm_platform_ioremap_resource_byname()
authorYang Yingliang <yangyingliang@huawei.com>
Sat, 29 Oct 2022 07:17:20 +0000 (15:17 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 31 Oct 2022 13:20:25 +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/20221029071720.3041094-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-mxic.c

index 65be8e085ab8392c25029b2aebd521b7610193ae..a3dba17390ebaf7e6733d07a2396143f0a124ccd 100644 (file)
@@ -772,8 +772,7 @@ static int mxic_spi_probe(struct platform_device *pdev)
        if (IS_ERR(mxic->send_dly_clk))
                return PTR_ERR(mxic->send_dly_clk);
 
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
-       mxic->regs = devm_ioremap_resource(&pdev->dev, res);
+       mxic->regs = devm_platform_ioremap_resource_byname(pdev, "regs");
        if (IS_ERR(mxic->regs))
                return PTR_ERR(mxic->regs);