From: Yang Yingliang Date: Wed, 19 Oct 2022 09:26:35 +0000 (+0800) Subject: spi: aspeed: Use devm_platform_{get_and_}ioremap_resource() X-Git-Tag: v6.6.7~3816^2~41 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d0cebbdf29922eaba4648a7a06d0d4ffd00439f;p=platform%2Fkernel%2Flinux-starfive.git spi: aspeed: Use devm_platform_{get_and_}ioremap_resource() Use the devm_platform_{get_and_}ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20221019092635.1176622-1-yangyingliang@huawei.com Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c index 33cefcf..710ff8c 100644 --- a/drivers/spi/spi-aspeed-smc.c +++ b/drivers/spi/spi-aspeed-smc.c @@ -734,13 +734,11 @@ static int aspeed_spi_probe(struct platform_device *pdev) aspi->data = data; aspi->dev = dev; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - aspi->regs = devm_ioremap_resource(dev, res); + aspi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(aspi->regs)) return PTR_ERR(aspi->regs); - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - aspi->ahb_base = devm_ioremap_resource(dev, res); + aspi->ahb_base = devm_platform_get_and_ioremap_resource(pdev, 1, &res); if (IS_ERR(aspi->ahb_base)) { dev_err(dev, "missing AHB mapping window\n"); return PTR_ERR(aspi->ahb_base);