Skip to content

Commit 5b04d44

Browse files
nxpfranklikwilczynski
authored andcommitted
PCI: imx6: Fix missing call to phy_power_off() in error handling
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+
1 parent 5cb3aa9 commit 5b04d44

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/pci/controller/dwc/pci-imx6.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp)
953953
ret = phy_power_on(imx6_pcie->phy);
954954
if (ret) {
955955
dev_err(dev, "waiting for PHY ready timeout!\n");
956-
goto err_phy_off;
956+
goto err_phy_exit;
957957
}
958958
}
959959

@@ -968,8 +968,9 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp)
968968
return 0;
969969

970970
err_phy_off:
971-
if (imx6_pcie->phy)
972-
phy_exit(imx6_pcie->phy);
971+
phy_power_off(imx6_pcie->phy);
972+
err_phy_exit:
973+
phy_exit(imx6_pcie->phy);
973974
err_clk_disable:
974975
imx6_pcie_clk_disable(imx6_pcie);
975976
err_reg_disable:

0 commit comments

Comments
 (0)