spi: atmel-quadspi: Disable clock in probe error path
authorLukas Wunner <lukas@wunner.de>
Sun, 8 Nov 2020 22:41:00 +0000 (23:41 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 10 Nov 2020 15:59:09 +0000 (15:59 +0000)
If the call to of_device_get_match_data() fails on probe of the Atmel
QuadSPI driver, the clock "aq->pclk" is erroneously not unprepared and
disabled.  Fix it.

Fixes: 2e5c88887358 ("spi: atmel-quadspi: add support for sam9x60 qspi controller")
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: <stable@vger.kernel.org> # v5.1+
Cc: Tudor Ambarus <tudor.ambarus@microchip.com>
Cc: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/8f8dc2815aa97b2378528f08f923bf81e19611f0.1604874488.git.lukas@wunner.de
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/atmel-quadspi.c

index 8c009c175f2c4631691b2081457365f5e5008408..b44521d4a2458de404d91b3ef0cab4b3a3951b6b 100644 (file)
@@ -594,7 +594,7 @@ static int atmel_qspi_probe(struct platform_device *pdev)
        if (!aq->caps) {
                dev_err(&pdev->dev, "Could not retrieve QSPI caps\n");
                err = -EINVAL;
-               goto exit;
+               goto disable_pclk;
        }
 
        if (aq->caps->has_qspick) {