diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2022-10-19 11:26:35 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-10-24 13:40:47 +0200 |
commit | 6d0cebbdf29922eaba4648a7a06d0d4ffd00439f (patch) | |
tree | 456fe1441ba5ba136543b8525d7159ef39eccf26 /drivers/spi/spi-aspeed-smc.c | |
parent | spi: amlogic: meson-spicc: Use pinctrl to drive CLK line when idle (diff) | |
download | linux-6d0cebbdf29922eaba4648a7a06d0d4ffd00439f.tar.xz linux-6d0cebbdf29922eaba4648a7a06d0d4ffd00439f.zip |
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 <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221019092635.1176622-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-aspeed-smc.c')
-rw-r--r-- | drivers/spi/spi-aspeed-smc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c index 33cefcf18392..710ff8cf121f 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); |