diff options
author | Marek Vasut <marek.vasut@gmail.com> | 2018-06-29 14:48:15 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2018-06-29 14:48:54 -0400 |
commit | 3c5777c372b6eb2e17802b3dc4bd5ebea45d9bcc (patch) | |
tree | 9ba3e19efe558cfbabe5b4fbdcaf92a2b2fadf62 | |
parent | 4050360f964694a3ac0c83badd1a441207c86889 (diff) |
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: 517ca93a7159 ("PCI: rcar: Add R-Car gen3 PHY support")
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Simon 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>
-rw-r--r-- | drivers/pci/controller/pcie-rcar.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/pci/controller/pcie-rcar.c b/drivers/pci/controller/pcie-rcar.c index 8b0d3206cbc4..c8febb009454 100644 --- a/drivers/pci/controller/pcie-rcar.c +++ b/drivers/pci/controller/pcie-rcar.c | |||
@@ -680,7 +680,11 @@ static int rcar_pcie_phy_init_gen3(struct rcar_pcie *pcie) | |||
680 | if (err) | 680 | if (err) |
681 | return err; | 681 | return err; |
682 | 682 | ||
683 | return phy_power_on(pcie->phy); | 683 | err = phy_power_on(pcie->phy); |
684 | if (err) | ||
685 | phy_exit(pcie->phy); | ||
686 | |||
687 | return err; | ||
684 | } | 688 | } |
685 | 689 | ||
686 | static int rcar_msi_alloc(struct rcar_msi *chip) | 690 | static int rcar_msi_alloc(struct rcar_msi *chip) |