diff options
author | Yangtao Li <frank.li@vivo.com> | 2023-07-06 06:27:26 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-07-10 00:51:41 +0300 |
commit | 4f81b540ccdf023b7b39432f5c0a26c7eadcc9ce (patch) | |
tree | 036f56765587bb75a375862c3f2857ecc8c492f5 /drivers/spi/spi-s3c64xx.c | |
parent | 2e4ed2577936476e0e9bb9a07158e94effb86285 (diff) | |
download | linux-4f81b540ccdf023b7b39432f5c0a26c7eadcc9ce.tar.xz |
spi: s3c64xx: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706032727.9180-7-frank.li@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-s3c64xx.c')
-rw-r--r-- | drivers/spi/spi-s3c64xx.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index fd55697144cc..ad008597c7d8 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1164,11 +1164,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) return dev_err_probe(&pdev->dev, -ENODEV, "Platform_data missing!\n"); - mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!mem_res) - return dev_err_probe(&pdev->dev, -ENXIO, - "Unable to get SPI MEM resource\n"); - irq = platform_get_irq(pdev, 0); if (irq < 0) return dev_err_probe(&pdev->dev, irq, "Failed to get IRQ\n"); @@ -1185,7 +1180,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) sdd->master = master; sdd->cntrlr_info = sci; sdd->pdev = pdev; - sdd->sfr_start = mem_res->start; if (pdev->dev.of_node) { ret = of_alias_get_id(pdev->dev.of_node, "spi"); if (ret < 0) @@ -1223,9 +1217,10 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) if (!is_polling(sdd)) master->can_dma = s3c64xx_spi_can_dma; - sdd->regs = devm_ioremap_resource(&pdev->dev, mem_res); + sdd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &mem_res); if (IS_ERR(sdd->regs)) return PTR_ERR(sdd->regs); + sdd->sfr_start = mem_res->start; if (sci->cfg_gpio && sci->cfg_gpio()) return dev_err_probe(&pdev->dev, -EBUSY, |