spi: spi-cavium-thunderx: Add missing clk_disable_unprepare()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 23 Aug 2016 15:03:48 +0000 (15:03 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 24 Aug 2016 11:37:43 +0000 (12:37 +0100)
Add the missing clk_disable_unprepare() before return in the probe
error handling case and remove.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-cavium-thunderx.c

index eff2a130ef0c58d73779f7bd317d8a786c4a4203..87793770624086892d57515605f5931e6939bd94 100644 (file)
@@ -80,6 +80,7 @@ static int thunderx_spi_probe(struct pci_dev *pdev,
        return 0;
 
 error:
+       clk_disable_unprepare(p->clk);
        spi_master_put(master);
        return ret;
 }
@@ -93,6 +94,7 @@ static void thunderx_spi_remove(struct pci_dev *pdev)
        if (!p)
                return;
 
+       clk_disable_unprepare(p->clk);
        /* Put everything in a known state. */
        writeq(0, p->register_base + OCTEON_SPI_CFG(p));
 }