spi: spi-nxp-fspi: Convert to devm_platform_ioremap_resource() and devm_platform_ioremap_resource_byname()

Use devm_platform_ioremap_resource() and
devm_platform_ioremap_resource_byname() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Link: https://lore.kernel.org/r/20230706032727.9180-4-frank.li@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Yangtao Li 2023-07-06 11:27:23 +08:00 committed by Mark Brown
parent cb8ea3dd55
commit 8c8e947b6b
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -1157,12 +1157,10 @@ static int nxp_fspi_probe(struct platform_device *pdev)
/* find the resources - configuration register address space */
if (is_acpi_node(dev_fwnode(f->dev)))
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
f->iobase = devm_platform_ioremap_resource(pdev, 0);
else
res = platform_get_resource_byname(pdev,
IORESOURCE_MEM, "fspi_base");
f->iobase = devm_platform_ioremap_resource_byname(pdev, "fspi_base");
f->iobase = devm_ioremap_resource(dev, res);
if (IS_ERR(f->iobase)) {
ret = PTR_ERR(f->iobase);
goto err_put_ctrl;