spi: spi-fsl-qspi: Use devm_platform_ioremap_resource_byname()
authorYang Yingliang <yangyingliang@huawei.com>
Sat, 24 Sep 2022 13:18:54 +0000 (21:18 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 26 Sep 2022 15:10:41 +0000 (16:10 +0100)
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/20220924131854.964923-3-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-qspi.c

index 46ae46a..85cc71b 100644 (file)
@@ -867,8 +867,7 @@ static int fsl_qspi_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, q);
 
        /* find the resources */
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "QuadSPI");
-       q->iobase = devm_ioremap_resource(dev, res);
+       q->iobase = devm_platform_ioremap_resource_byname(pdev, "QuadSPI");
        if (IS_ERR(q->iobase)) {
                ret = PTR_ERR(q->iobase);
                goto err_put_ctrl;