From: Wei Yongjun Date: Wed, 30 Jul 2014 00:54:07 +0000 (+0800) Subject: ahci: imx: add missing clk_disable_unprepare() on error in imx_sata_enable() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d7a94406d652dd319746d1735efe363f626e3a6c;p=karo-tx-linux.git ahci: imx: add missing clk_disable_unprepare() on error in imx_sata_enable() Add the missing clk_disable_unprepare() before return from imx_sata_enable() in the phy reset error handling case. Signed-off-by: Wei Yongjun Acked-by: Shawn Guo Signed-off-by: Tejun Heo (cherry picked from commit 19f5be0f40922717e2b6e39a9822e7e7f30fd81f) --- diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c index dae1d5632b3d..1e5fa5f21aff 100644 --- a/drivers/ata/ahci_imx.c +++ b/drivers/ata/ahci_imx.c @@ -259,7 +259,7 @@ static int imx_sata_enable(struct ahci_host_priv *hpriv) ret = imx_sata_phy_reset(hpriv); if (ret) { dev_err(dev, "failed to reset phy: %d\n", ret); - goto disable_regulator; + goto disable_clk; } } @@ -267,6 +267,8 @@ static int imx_sata_enable(struct ahci_host_priv *hpriv) return 0; +disable_clk: + clk_disable_unprepare(imxpriv->sata_ref_clk); disable_regulator: if (hpriv->target_pwr) regulator_disable(hpriv->target_pwr);