diff options
author | Yangtao Li <frank.li@vivo.com> | 2023-07-06 06:27:21 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-07-10 00:51:37 +0300 |
commit | 2ae3c98b6e80f5b99afd9eafbdfab5146330dae5 (patch) | |
tree | e53792683a69500cf299519f57df382920c1541c /drivers | |
parent | 616a733ccaee2412cd8def29f6f106e22c3cfabb (diff) | |
download | linux-2ae3c98b6e80f5b99afd9eafbdfab5146330dae5.tar.xz |
spi: davinci: 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-2-frank.li@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/spi-davinci.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index b04811c911e2..a85fd0cb4a5e 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c @@ -895,25 +895,16 @@ static int davinci_spi_probe(struct platform_device *pdev) goto free_master; } - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (r == NULL) { - ret = -ENOENT; - goto free_master; - } - - dspi->pbase = r->start; - - dspi->base = devm_ioremap_resource(&pdev->dev, r); + dspi->base = devm_platform_get_and_ioremap_resource(pdev, 0, &r); if (IS_ERR(dspi->base)) { ret = PTR_ERR(dspi->base); goto free_master; } + dspi->pbase = r->start; init_completion(&dspi->done); ret = platform_get_irq(pdev, 0); - if (ret == 0) - ret = -EINVAL; if (ret < 0) goto free_master; dspi->irq = ret; |