Commit 4f81b540 authored by Yangtao Li's avatar Yangtao Li Committed by Mark Brown

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: default avatarYangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706032727.9180-7-frank.li@vivo.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2e4ed257
...@@ -1164,11 +1164,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) ...@@ -1164,11 +1164,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
return dev_err_probe(&pdev->dev, -ENODEV, return dev_err_probe(&pdev->dev, -ENODEV,
"Platform_data missing!\n"); "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); irq = platform_get_irq(pdev, 0);
if (irq < 0) if (irq < 0)
return dev_err_probe(&pdev->dev, irq, "Failed to get IRQ\n"); 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) ...@@ -1185,7 +1180,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
sdd->master = master; sdd->master = master;
sdd->cntrlr_info = sci; sdd->cntrlr_info = sci;
sdd->pdev = pdev; sdd->pdev = pdev;
sdd->sfr_start = mem_res->start;
if (pdev->dev.of_node) { if (pdev->dev.of_node) {
ret = of_alias_get_id(pdev->dev.of_node, "spi"); ret = of_alias_get_id(pdev->dev.of_node, "spi");
if (ret < 0) if (ret < 0)
...@@ -1223,9 +1217,10 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) ...@@ -1223,9 +1217,10 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
if (!is_polling(sdd)) if (!is_polling(sdd))
master->can_dma = s3c64xx_spi_can_dma; 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)) if (IS_ERR(sdd->regs))
return PTR_ERR(sdd->regs); return PTR_ERR(sdd->regs);
sdd->sfr_start = mem_res->start;
if (sci->cfg_gpio && sci->cfg_gpio()) if (sci->cfg_gpio && sci->cfg_gpio())
return dev_err_probe(&pdev->dev, -EBUSY, return dev_err_probe(&pdev->dev, -EBUSY,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment