From efee827d3ddb8bd219392cbedc5e5afc6ccfd617 Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Wed, 23 Aug 2017 15:03:17 +0800 Subject: [PATCH] PCI: rockchip: Disable vpcie0v9 if resume_noirq fails Disable vpcie0v9 regulator if resume_noirq fails. Signed-off-by: Jeffy Chen Signed-off-by: Shawn Lin Signed-off-by: Bjorn Helgaas --- drivers/pci/host/pcie-rockchip.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c index 7d7c69ac1261..ac8b8e8270f7 100644 --- a/drivers/pci/host/pcie-rockchip.c +++ b/drivers/pci/host/pcie-rockchip.c @@ -1488,7 +1488,7 @@ static int __maybe_unused rockchip_pcie_resume_noirq(struct device *dev) err = rockchip_pcie_enable_clocks(rockchip); if (err) - return err; + goto err_disable_0v9; err = rockchip_pcie_init_port(rockchip); if (err) @@ -1508,6 +1508,9 @@ err_err_deinit_port: rockchip_pcie_deinit_phys(rockchip); err_pcie_resume: rockchip_pcie_disable_clocks(rockchip); +err_disable_0v9: + if (!IS_ERR(rockchip->vpcie0v9)) + regulator_disable(rockchip->vpcie0v9); return err; } -- 2.20.1