Skip to content

Commit

Permalink
ahci: imx: add missing clk_disable_unprepare() on error in imx_sata_e…
Browse files Browse the repository at this point in the history
…nable()

Add the missing clk_disable_unprepare() before return from
imx_sata_enable() in the phy reset error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Wei Yongjun authored and Tejun Heo committed Jul 30, 2014
1 parent 0185b1b commit 19f5be0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/ata/ahci_imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,16 @@ 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;
}
}

usleep_range(1000, 2000);

return 0;

disable_clk:
clk_disable_unprepare(imxpriv->sata_ref_clk);
disable_regulator:
if (hpriv->target_pwr)
regulator_disable(hpriv->target_pwr);
Expand Down

0 comments on commit 19f5be0

Please sign in to comment.