提交 3c5777c3 编写于 作者: M Marek Vasut 提交者: Bjorn Helgaas

PCI: rcar: Clean up PHY init on failure

If the Gen3 PHY fails to power up, the code does not undo the
initialization caused by phy_init(). Add the missing failure
handling to the rcar_pcie_phy_init_gen3() function.

Fixes: 517ca93a ("PCI: rcar: Add R-Car gen3 PHY support")
Reported-by: NGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: NMarek Vasut <marek.vasut+renesas@gmail.com>
Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be>
Acked-by: NSimon Horman <horms+renesas@verge.net.au>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Phil Edworthy <phil.edworthy@renesas.com>
Cc: Wolfram Sang <wsa@the-dreams.de>
上级 4050360f
...@@ -680,7 +680,11 @@ static int rcar_pcie_phy_init_gen3(struct rcar_pcie *pcie) ...@@ -680,7 +680,11 @@ static int rcar_pcie_phy_init_gen3(struct rcar_pcie *pcie)
if (err) if (err)
return err; return err;
return phy_power_on(pcie->phy); err = phy_power_on(pcie->phy);
if (err)
phy_exit(pcie->phy);
return err;
} }
static int rcar_msi_alloc(struct rcar_msi *chip) static int rcar_msi_alloc(struct rcar_msi *chip)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册