]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drivers/spi/spi-tegra114.c clean use of devm_ioremap_resource()
authorLaurent Navet <laurent.navet@gmail.com>
Tue, 14 May 2013 10:07:12 +0000 (12:07 +0200)
committerMark Brown <broonie@linaro.org>
Tue, 20 Aug 2013 10:43:59 +0000 (11:43 +0100)
Check of 'r' and calls to dev_err are already done in devm_ioremap_resource,
so no need to do them twice.

Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-tegra114.c

index 8c99c00515c4cc7d79d408bd2e1cd71c336af8f7..bb435ca994a56b82fa479ab55692354ddad8baae 100644 (file)
@@ -1059,17 +1059,12 @@ static int tegra_spi_probe(struct platform_device *pdev)
        spin_lock_init(&tspi->lock);
 
        r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!r) {
-               dev_err(&pdev->dev, "No IO memory resource\n");
-               ret = -ENODEV;
-               goto exit_free_master;
-       }
-       tspi->phys = r->start;
        tspi->base = devm_ioremap_resource(&pdev->dev, r);
        if (IS_ERR(tspi->base)) {
                ret = PTR_ERR(tspi->base);
                goto exit_free_master;
        }
+       tspi->phys = r->start;
 
        spi_irq = platform_get_irq(pdev, 0);
        tspi->irq = spi_irq;