]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
PCI: imx6: Fix missing call to phy_power_off() in error handling
authorFrank Li <Frank.Li@nxp.com>
Mon, 29 Jul 2024 20:18:10 +0000 (16:18 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:33:24 +0000 (16:33 +0200)
commit 5b04d44d5c74e4d8aab1678496b84700b4b343fe 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: cbcf8722b523 ("phy: freescale: imx8m-pcie: Fix the wrong order of phy_init() and phy_power_on()")
Link: https://lore.kernel.org/linux-pci/20240729-pci2_upstream-v8-3-b68ee5ef2b4d@nxp.com
Signed-off-by: Frank Li <Frank.Li@nxp.com>
[kwilczynski: commit log]
Signed-off-by: Krzysztof WilczyƄski <kwilczynski@kernel.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: <stable@vger.kernel.org> # 6.1+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/controller/dwc/pci-imx6.c

index 917c69edee1d54199cdf19106af61d9578359159..aed3251b40872efd5a35d616f03377dc4883e050 100644 (file)
@@ -958,7 +958,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;
                }
        }
 
@@ -973,8 +973,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: