spi: amd: Fix duplicate iounmap in error path
authorLukas Wunner <lukas@wunner.de>
Mon, 4 May 2020 11:12:01 +0000 (13:12 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 4 May 2020 16:18:45 +0000 (17:18 +0100)
The AMD SPI driver uses devm_ioremap_resource() to map its registers, so
they're automatically unmapped via device_release() when the last ref on
the SPI controller is dropped.  The additional iounmap() in the ->probe()
error path is thus unnecessary.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Link: https://lore.kernel.org/r/497cc38ae2beb7900ae05a1463eb83ff96e2770e.1588590210.git.lukas@wunner.de
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-amd.c

index c7cfc3dc20b16be49333f7f4643f88eb39824edc..65b53eee5be9d396b4bea9decb09394d45adc6f2 100644 (file)
@@ -285,14 +285,12 @@ static int amd_spi_probe(struct platform_device *pdev)
        err = spi_register_master(master);
        if (err) {
                dev_err(dev, "error %d registering SPI controller\n", err);
-               goto err_iounmap;
+               goto err_free_master;
        }
        platform_set_drvdata(pdev, amd_spi);
 
        return 0;
 
-err_iounmap:
-       iounmap(amd_spi->io_remap_addr);
 err_free_master:
        spi_master_put(master);