spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe
[linux-2.6-microblaze.git] / drivers / spi / spi-mt7621.c
index 2c3b7a2..2cdae79 100644 (file)
@@ -353,6 +353,7 @@ static int mt7621_spi_probe(struct platform_device *pdev)
        master = spi_alloc_master(&pdev->dev, sizeof(*rs));
        if (!master) {
                dev_info(&pdev->dev, "master allocation failed\n");
+               clk_disable_unprepare(clk);
                return -ENOMEM;
        }
 
@@ -377,6 +378,7 @@ static int mt7621_spi_probe(struct platform_device *pdev)
        ret = device_reset(&pdev->dev);
        if (ret) {
                dev_err(&pdev->dev, "SPI reset failed!\n");
+               clk_disable_unprepare(clk);
                return ret;
        }