Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
PCI: imx6: Fix missing call to phy_power_off() in error handling
Browse files Browse the repository at this point in the history
commit 5b04d44 upstream.

Fix missing call to phy_power_off() in the error path of
imx6_pcie_host_init(). Remove unnecessary check for imx6_pcie->phy
as the PHY API already handles NULL pointers.

Fixes: cbcf872 ("phy: freescale: imx8m-pcie: Fix the wrong order of phy_init() and phy_power_on()")
Link: https://lore.kernel.org/linux-pci/[email protected]
Signed-off-by: Frank Li <[email protected]>
[kwilczynski: commit log]
Signed-off-by: Krzysztof Wilczyński <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Cc: <[email protected]> # 6.1+
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
nxpfrankli authored and gregkh committed Oct 2, 2024
1 parent 77a5a7a commit 7592b16
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/pci/controller/dwc/pci-imx6.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp)
ret = phy_power_on(imx6_pcie->phy);
if (ret) {
dev_err(dev, "waiting for PHY ready timeout!\n");
goto err_phy_off;
goto err_phy_exit;
}
}

Expand All @@ -971,8 +971,9 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp)
return 0;

err_phy_off:
if (imx6_pcie->phy)
phy_exit(imx6_pcie->phy);
phy_power_off(imx6_pcie->phy);
err_phy_exit:
phy_exit(imx6_pcie->phy);
err_clk_disable:
imx6_pcie_clk_disable(imx6_pcie);
err_reg_disable:
Expand Down

0 comments on commit 7592b16

Please sign in to comment.